Skip to content

Commit 66a3172

Browse files
committed
Keep N=1000; still no div for judge
1 parent 6402fa2 commit 66a3172

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

benchmark/runbench.jl

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using Pkg
55
Pkg.activate(@__DIR__)
66
using PkgBenchmark, BenchmarkTools, Statistics
77

8-
const N = 1 #_000
8+
const N = 1_000
99

1010
import Base: -, /
1111
function -(a::BenchmarkTools.TrialEstimate, b::BenchmarkTools.TrialEstimate)
@@ -38,6 +38,22 @@ function postprocess(results::BenchmarkGroup)
3838
end
3939
results
4040
end
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

4258
function runbench()
4359
bench_results = withenv("BENCH_NUM_ITERS"=>string(N)) do
@@ -49,7 +65,7 @@ end
4965

5066
function 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
5470
end
5571
function judgebench(baseline::Union{String, BenchmarkConfig})

0 commit comments

Comments
 (0)