This repository was archived by the owner on Dec 16, 2022. It is now read-only.
forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathperfcomp.jl
46 lines (36 loc) · 1.59 KB
/
perfcomp.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# usage: perfcomp.jl <baseline file> [<suite>]
# This will run the specified suite (default "all") and compare it to stored
# results in the baseline file. Only test names present in both will be
# compared.
# The file format is the output of running `make` in this directory.
function readperf(f)
[ rstrip(l[1:19])=>[float64(l[20:27]),float64(l[29:36]),float64(l[38:45]),float64(l[47:54])] for l in eachline(f) ]
end
function main()
baseline = readperf(open(ARGS[1]))
torun = length(ARGS) > 1 ? ARGS[2] : "all"
io,p = readsfrom(`make -s $torun`)
newp = readperf(io)
names = sort(intersect(keys(baseline),keys(newp)))
means0 = [ baseline[n][3] for n in names ]
means1 = [ newp[n][3] for n in names ]
change = (means0 - means1) ./ means0
println("test name old new % speedup % st. dev")
println("-----------------------------------------------------------")
for i = 1:length(names)
print(rpad(names[i],19))
print(lpad(string(means0[i]),8)," ")
print(lpad(string(means1[i]),8)," ")
dev = baseline[names[i]][4]/means0[i]
@printf "%7.2f%% %7.2f%%\n" change[i]*100 dev*100
end
println()
minname = names[indmin(change)]
maxname = names[indmax(change)]
minstd = baseline[minname][4]/baseline[minname][3]
maxstd = baseline[maxname][4]/baseline[maxname][3]
@printf "min %7.2f%% (std %7.2f%%) %s\n" minimum(change)*100 minstd*100 minname
@printf "max %7.2f%% (std %7.2f%%) %s\n" maximum(change)*100 maxstd*100 maxname
@printf "avg %7.2f%%\n" mean(change)*100
end
main()