Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion benchmarks/correlations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ function benchmark_correlations!(SUITE)

SUITE["Correlations"]["two-time"] = BenchmarkGroup()

# Allocation-heavy: a full master-equation solve that rebuilds operators every
# ODE step (~0.5 GB / call). `gcsample=true` runs a GC before each sample so the
# timing isn't dominated by non-deterministic GC pauses carried over between
# samples, which otherwise gives this benchmark a ~4x run-to-run spread.
SUITE["Correlations"]["two-time"]["single photon cavity"] =
@benchmarkable correlation_matrix($T, $ρt, $input_output, $Ls)
@benchmarkable correlation_matrix($T, $ρt, $input_output, $Ls) gcsample = true

return nothing
end
4 changes: 3 additions & 1 deletion benchmarks/interaction_picture.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ function benchmark_interaction_picture!(SUITE)

SUITE["Interaction Picture"]["coefficient matrix M"] = BenchmarkGroup()

# Allocation-heavy ODE solve: GC before each sample to stabilize the timing
# (see the note in runbenchmarks.jl).
SUITE["Interaction Picture"]["coefficient matrix M"]["numerical (ODE)"] =
@benchmarkable solve_mode_evolution($A_uv, $T)
@benchmarkable solve_mode_evolution($A_uv, $T) gcsample = true

SUITE["Interaction Picture"]["coefficient matrix M"]["analytical (2 equal modes)"] =
@benchmarkable solve_mode_evolution_symmetric($u, $T)
Expand Down
12 changes: 10 additions & 2 deletions benchmarks/runbenchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ benchmark_correlations!(SUITE)

BenchmarkTools.tune!(SUITE)
results = BenchmarkTools.run(SUITE; verbose = true)
display(median(results))

BenchmarkTools.save("benchmarks_output.json", median(results))
# Report the minimum rather than the median. The minimum is BenchmarkTools'
# recommended estimator for tracking: measurement noise (GC pauses, scheduler
# preemption, frequency scaling) is strictly additive, so the minimum is the
# most reproducible estimate of the underlying cost and the least sensitive to
# cross-runner variance. Allocation-heavy benchmarks additionally set
# `gcsample=true` so each sample starts from a clean heap (see the individual
# `@benchmarkable`s).
display(minimum(results))

BenchmarkTools.save("benchmarks_output.json", minimum(results))
Loading