@@ -5,7 +5,7 @@ using Pkg
55Pkg. activate (@__DIR__ )
66using PkgBenchmark, BenchmarkTools, Statistics
77
8- const N = 1 # _000
8+ const N = 1_000
99
1010import Base: - , /
1111function - (a:: BenchmarkTools.TrialEstimate , b:: BenchmarkTools.TrialEstimate )
@@ -38,6 +38,22 @@ function postprocess(results::BenchmarkGroup)
3838 end
3939 results
4040end
41+ function postprocess_no_div (results:: BenchmarkGroup )
42+ for (op, op_group) in results. data
43+ op_results = op_group. data
44+ for (type, type_group) in op_results
45+ benchresults = type_group. data
46+ if op == " identity"
47+ # For :identity, bench and base are identical so we don't want to subtract.
48+ op_results[type] = median (benchresults[" bench" ])
49+ else
50+ op_results[type] = median (benchresults[" bench" ]) - median (benchresults[" base" ])
51+ end
52+ end
53+ end
54+ results
55+ end
56+
4157
4258function runbench ()
4359 bench_results = withenv (" BENCH_NUM_ITERS" => string (N)) do
4965
5066function judgebench (target:: Union{String, BenchmarkConfig} , baseline:: Union{String, BenchmarkConfig} )
5167 bench_results = withenv (" BENCH_NUM_ITERS" => string (N)) do
52- judge (" FixedPointDecimals" , target, baseline; f= identity, postprocess= postprocess )
68+ judge (" FixedPointDecimals" , target, baseline; f= identity, postprocess= postprocess_no_div )
5369 end
5470end
5571function judgebench (baseline:: Union{String, BenchmarkConfig} )
0 commit comments