/
perf.jl
41 lines (36 loc) · 1 KB
/
perf.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
using GLPK
function print_help()
println("""
Usage
perf.jl [arg] [name]
[arg]
--new Begin a new benchmark comparison
--compare Run another benchmark and compare to existing
[name] A name for the benchmark test
Examples
git checkout master
julia perf.jl --new master
git checkout approach_1
julia perf.jl --new approach_1
git checkout approach_2
julia perf.jl --compare master
julia perf.jl --compare approach_1
""")
end
if length(ARGS) != 2
print_help()
else
const Benchmarks = GLPK.MOI.Benchmarks
const suite = Benchmarks.suite(() -> GLPK.Optimizer())
if ARGS[1] == "--new"
Benchmarks.create_baseline(
suite, ARGS[2]; directory = @__DIR__, verbose = true
)
elseif ARGS[1] == "--compare"
Benchmarks.compare_against_baseline(
suite, ARGS[2]; directory = @__DIR__, verbose = true
)
else
print_help()
end
end