Skip to content

Commit c5ac6a5

Browse files
committed
Added option to change postprocess function in judgebench for testing purposes
1 parent a58dbfd commit c5ac6a5

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

benchmark/runbench.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,27 @@ end
5656

5757

5858
function runbench()
59+
rm(joinpath(@__DIR__, "tune.json")) # Remove the existing tune.json file.
5960
bench_results = withenv("BENCH_NUM_ITERS"=>string(N)) do
6061
benchmarkpkg("FixedPointDecimals"; postprocess=postprocess)
6162
end
6263

6364
export_markdown(joinpath(@__DIR__, "results.md"), bench_results)
65+
return bench_results
6466
end
6567

66-
function judgebench(target::Union{String, BenchmarkConfig}, baseline::Union{String, BenchmarkConfig})
68+
function judgebench(target::Union{String, BenchmarkConfig}, baseline::Union{String, BenchmarkConfig},
69+
postprocess_fn=postprocess_no_div)
70+
try rm(joinpath(@__DIR__, "tune.json")) catch end # Remove the existing tune.json file.
6771
bench_results = withenv("BENCH_NUM_ITERS"=>string(N)) do
68-
judge("FixedPointDecimals", target, baseline; f=identity, postprocess=postprocess_no_div)
72+
if do_postprocessing
73+
judge("FixedPointDecimals", target, baseline; f=identity, postprocess=postprocess_fn)
74+
else
75+
judge("FixedPointDecimals", target, baseline)
76+
end
6977
end
78+
export_markdown(joinpath(@__DIR__, "judge.md"), bench_results)
79+
return bench_results
7080
end
7181
function judgebench(baseline::Union{String, BenchmarkConfig})
7282
judgebench(BenchmarkConfig(), baseline)

0 commit comments

Comments
 (0)