-
-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathrunbenchmarks.jl
More file actions
81 lines (67 loc) · 1.92 KB
/
runbenchmarks.jl
File metadata and controls
81 lines (67 loc) · 1.92 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Copied from
# https://github.com/kul-forbes/ProximalOperators.jl/tree/master/benchmark
using ArgParse
using PkgBenchmark
using Markdown
function displayresult(result)
md = sprint(export_markdown, result)
md = replace(md, ":x:" => "❌")
md = replace(md, ":white_check_mark:" => "✅")
display(Markdown.parse(md))
end
function printnewsection(name)
println()
println()
println()
printstyled("▃" ^ displaysize(stdout)[2]; color=:blue)
println()
printstyled(name; bold=true)
println()
println()
end
function parse_commandline()
s = ArgParseSettings()
@add_arg_table! s begin
"--target"
help = "the branch/commit/tag to use as target"
default = "HEAD"
"--baseline"
help = "the branch/commit/tag to use as baseline"
default = "master"
"--retune"
help = "force re-tuning (ignore existing tuning data)"
action = :store_true
end
return parse_args(s)
end
function main()
parsed_args = parse_commandline()
mkconfig(; kwargs...) =
BenchmarkConfig(
env = Dict(
"JULIA_NUM_THREADS" => "1",
);
kwargs...
)
target = parsed_args["target"]
group_target = benchmarkpkg(
dirname(@__DIR__),
mkconfig(id = target),
resultfile = joinpath(@__DIR__, "result-$(target).json"),
retune = parsed_args["retune"],
)
baseline = parsed_args["baseline"]
group_baseline = benchmarkpkg(
dirname(@__DIR__),
mkconfig(id = baseline),
resultfile = joinpath(@__DIR__, "result-$(baseline).json"),
)
printnewsection("Target result")
displayresult(group_target)
printnewsection("Baseline result")
displayresult(group_baseline)
judgement = judge(group_target, group_baseline)
printnewsection("Judgement result")
displayresult(judgement)
end
main()