Skip to content

Commit

Permalink
Added option to change postprocess function in judgebench for testing…
Browse files Browse the repository at this point in the history
… purposes
  • Loading branch information
NHDaly committed Jan 28, 2019
1 parent a58dbfd commit c5ac6a5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions benchmark/runbench.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,27 @@ end


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

export_markdown(joinpath(@__DIR__, "results.md"), bench_results)
return bench_results
end

function judgebench(target::Union{String, BenchmarkConfig}, baseline::Union{String, BenchmarkConfig})
function judgebench(target::Union{String, BenchmarkConfig}, baseline::Union{String, BenchmarkConfig},
postprocess_fn=postprocess_no_div)
try rm(joinpath(@__DIR__, "tune.json")) catch end # Remove the existing tune.json file.
bench_results = withenv("BENCH_NUM_ITERS"=>string(N)) do
judge("FixedPointDecimals", target, baseline; f=identity, postprocess=postprocess_no_div)
if do_postprocessing
judge("FixedPointDecimals", target, baseline; f=identity, postprocess=postprocess_fn)
else
judge("FixedPointDecimals", target, baseline)
end
end
export_markdown(joinpath(@__DIR__, "judge.md"), bench_results)
return bench_results
end
function judgebench(baseline::Union{String, BenchmarkConfig})
judgebench(BenchmarkConfig(), baseline)
Expand Down

0 comments on commit c5ac6a5

Please sign in to comment.