|
56 | 56 |
|
57 | 57 |
|
58 | 58 | function runbench()
|
| 59 | + rm(joinpath(@__DIR__, "tune.json")) # Remove the existing tune.json file. |
59 | 60 | bench_results = withenv("BENCH_NUM_ITERS"=>string(N)) do
|
60 | 61 | benchmarkpkg("FixedPointDecimals"; postprocess=postprocess)
|
61 | 62 | end
|
62 | 63 |
|
63 | 64 | export_markdown(joinpath(@__DIR__, "results.md"), bench_results)
|
| 65 | + return bench_results |
64 | 66 | end
|
65 | 67 |
|
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. |
67 | 71 | bench_results = withenv("BENCH_NUM_ITERS"=>string(N)) do
|
68 |
| - judge("FixedPointDecimals", target, baseline; f=identity, postprocess=postprocess_no_div) |
| 72 | + if postprocess_fn != nothing |
| 73 | + judge("FixedPointDecimals", target, baseline; f=identity, postprocess=postprocess_fn) |
| 74 | + else |
| 75 | + judge("FixedPointDecimals", target, baseline) |
| 76 | + end |
69 | 77 | end
|
| 78 | + export_markdown(joinpath(@__DIR__, "judge.md"), bench_results) |
| 79 | + return bench_results |
70 | 80 | end
|
71 | 81 | function judgebench(baseline::Union{String, BenchmarkConfig})
|
72 | 82 | judgebench(BenchmarkConfig(), baseline)
|
|
0 commit comments