-
Notifications
You must be signed in to change notification settings - Fork 79
/
perf.jl
50 lines (44 loc) · 1.32 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
42
43
44
45
46
47
48
49
50
# Copyright (c) 2015 Dahua Lin, Miles Lubin, Joey Huchette, Iain Dunning, and
# contributors
#
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
using Gurobi
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 = Gurobi.MOI.Benchmarks
const GUROBI_ENV = Gurobi.Env()
const suite = Benchmarks.suite() do
Gurobi.Optimizer(GUROBI_ENV, OutputFlag = 0)
end
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