mcframework.benchmark.run_suite#

mcframework.benchmark.run_suite(sim: MonteCarloSimulation, sizes: Sequence[int], specs: Sequence[BackendSpec], *, n_workers: int | None = None, repeats: int = 1, quick: bool = False, max_sequential_size: int = 1000000, progress: Callable[[str, int, int], None] | None = None) BenchmarkReport[source]#

Benchmark sim across the sizes x specs matrix.

Parameters:
simMonteCarloSimulation

Simulation to benchmark.

sizessequence of int

Simulation sizes to time.

specssequence of BackendSpec

Backends to time.

n_workersint, optional

Worker count for parallel backends (defaults to CPU count downstream).

repeatsint, default 1

Timed repetitions per cell (best time kept).

quickbool, default False

Skip the sequential backend above max_sequential_size to keep the run fast (sequential is O(n) and dominates wall time at large sizes).

max_sequential_sizeint, default 1_000_000

Sequential cutoff used when quick is enabled.

progresscallable(), optional

Called as progress(label, n, total) after each measured cell.

Returns:
BenchmarkReport