comparison benchmark/benchmark_utils.jl @ 1315:0551fd71682f tooling/benchmarks

Workaround for the display of revision in html
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 27 Apr 2023 16:05:15 +0200
parents 708dbfd5edb9
children 7110851b9c87
comparison
equal deleted inserted replaced
1314:6ae9b98b15b9 1315:0551fd71682f
28 Runs the benchmark suite for the current working directory and returns a `PkgBenchmark.BenchmarkResult` 28 Runs the benchmark suite for the current working directory and returns a `PkgBenchmark.BenchmarkResult`
29 """ 29 """
30 function run_benchmark(;kwargs...) 30 function run_benchmark(;kwargs...)
31 r = PkgBenchmark.benchmarkpkg(Sbplib; kwargs...) 31 r = PkgBenchmark.benchmarkpkg(Sbplib; kwargs...)
32 32
33 rev = hg_id() 33 rev = hg_rev() # Should be changed to hg_id() when the html can handle it.
34 34
35 return add_rev_info(r, rev) 35 return add_rev_info(r, rev)
36 end 36 end
37 37
38 """ 38 """
74 return PkgBenchmark.judge(t,b,f; judgekwargs...) 74 return PkgBenchmark.judge(t,b,f; judgekwargs...)
75 end 75 end
76 76
77 77
78 function add_rev_info(benchmarkresult, rev) 78 function add_rev_info(benchmarkresult, rev)
79 if endswith(rev,"+")
80 revstr = "+$rev" # Workaround for the bad presentation of BenchmarkResults.
81 else
82 revstr = rev
83 end
84
79 return PkgBenchmark.BenchmarkResults( 85 return PkgBenchmark.BenchmarkResults(
80 benchmarkresult.name, 86 benchmarkresult.name,
81 rev, 87 revstr,
82 benchmarkresult.benchmarkgroup, 88 benchmarkresult.benchmarkgroup,
83 benchmarkresult.date, 89 benchmarkresult.date,
84 benchmarkresult.julia_commit, 90 benchmarkresult.julia_commit,
85 benchmarkresult.vinfo, 91 benchmarkresult.vinfo,
86 benchmarkresult.benchmarkconfig, 92 benchmarkresult.benchmarkconfig,