comparison benchmark/benchmark_utils.jl @ 1954:b0915f43b122 feature/sbp_operators/laplace_curvilinear

Merge feature/grids/geometry_functions
author Jonatan Werpers <jonatan@werpers.com>
date Sat, 08 Feb 2025 09:38:58 +0100
parents 9d708f3300d5
children
comparison
equal deleted inserted replaced
1953:835b1dcee38e 1954:b0915f43b122
8 const diffinitive_root = splitpath(pathof(Diffinitive))[1:end-2] |> joinpath 8 const diffinitive_root = splitpath(pathof(Diffinitive))[1:end-2] |> joinpath
9 const results_dir = mkpath(joinpath(diffinitive_root, "benchmark/results")) 9 const results_dir = mkpath(joinpath(diffinitive_root, "benchmark/results"))
10 const template_path = joinpath(diffinitive_root, "benchmark/result.tmpl") 10 const template_path = joinpath(diffinitive_root, "benchmark/result.tmpl")
11 11
12 """ 12 """
13 mainmain(;rev=nothing, target=nothing, baseline=nothing , kwargs...) 13 main(;rev=nothing, target=nothing, baseline=nothing , kwargs...)
14 14
15 Calls `run_benchmark(args...; kwargs...)` and writes the results as an HTML 15 Calls `run_benchmark(args...; kwargs...)` and writes the results as an HTML
16 file in `benchmark/results`. 16 file in `benchmark/results`.
17 17
18 * If `rev` is set, the benchmarks are run for the given mercurial revision. 18 * If `rev` is set, the benchmarks are run for the given mercurial revision.
80 80
81 `target` and `baseline` can be any identifier compatible with `hg update`. 81 `target` and `baseline` can be any identifier compatible with `hg update`.
82 82
83 Returns a `PkgBenchmark.BenchmarkJudgement` 83 Returns a `PkgBenchmark.BenchmarkJudgement`
84 """ 84 """
85 function compare_benchmarks(target, baseline, f=minimum; judgekwargs=Dict(), kwargs...) 85 function compare_benchmarks(target, baseline; f=minimum, judgekwargs=Dict(), kwargs...)
86 t = run_benchmark(target; kwargs...) 86 t = run_benchmark(target; kwargs...)
87 b = run_benchmark(baseline; kwargs...) 87 b = run_benchmark(baseline; kwargs...)
88 88
89 return PkgBenchmark.judge(t,b,f; judgekwargs...) 89 return PkgBenchmark.judge(t,b,f; judgekwargs...)
90 end 90 end
95 Compare the results at the current working directory with the revision 95 Compare the results at the current working directory with the revision
96 specified in `baseline`. 96 specified in `baseline`.
97 97
98 Accepts the same arguments as the two revision version. 98 Accepts the same arguments as the two revision version.
99 """ 99 """
100 function compare_benchmark(baseline, f=minimum; judgekwargs=Dict(), kwargs...) 100 function compare_benchmarks(baseline; f=minimum, judgekwargs=Dict(), kwargs...)
101 t = run_benchmark(;kwargs...) 101 t = run_benchmark(;kwargs...)
102 b = run_benchmark(baseline; kwargs...) 102 b = run_benchmark(baseline; kwargs...)
103 103
104 return PkgBenchmark.judge(t,b,f; judgekwargs...) 104 return PkgBenchmark.judge(t,b,f; judgekwargs...)
105 end 105 end