-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbenchmark-utils.jl
More file actions
40 lines (29 loc) · 856 Bytes
/
benchmark-utils.jl
File metadata and controls
40 lines (29 loc) · 856 Bytes
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
PERFORMANCE_TEST_COMMAND = `./julia/julia ./julia/test/perf/micro/perf.jl`
function parse_micro_benchmarks(raw_results)
micro_times = Dict()
results = split(raw_results, '\n')
# get the average results for each test
for result in results
isempty(result) && continue
r = split(result, ',')
test = r[2]
time = parse(r[5])
micro_times[test] = time
end
micro_times
end
function establish_baseline_times()
# run the benchmarks without any passes configured
run_benchmarks([])
end
function run_benchmarks(passes::Array)
pass_file = open("passes.conf", "w")
write(pass_file, join(passes, '\n'))
close(pass_file)
run_benchmarks()
end
function run_benchmarks()
gc()
raw_results = readall(PERFORMANCE_TEST_COMMAND)
parse_micro_benchmarks(raw_results)
end