mcframework.benchmark.BenchmarkReport#

class mcframework.benchmark.BenchmarkReport[source]#

Bases: object

Collection of BenchmarkResult rows plus run context.

Attributes:
resultslist[BenchmarkResult]

All successfully measured cells.

sizeslist[int]

Simulation sizes that were attempted.

systemdict

Output of system_info() captured at run time.

Methods

all_sizes

Sorted unique sizes that actually produced a result.

best

Fastest result at size n (default: the largest measured size).

by_backend

Group results by backend label, each list sorted by n_simulations.

speedups

Speedup factors relative to baseline, as (n, factor) pairs.

summary_table

Render a fixed-width execution-time + speedup summary (N/A for gaps).

to_dict

JSON-serializable view (system info, sizes, and result rows).

all_sizes() list[int][source]#

Sorted unique sizes that actually produced a result.

best(n: int | None = None) BenchmarkResult | None[source]#

Fastest result at size n (default: the largest measured size).

Parameters:
nint, optional

Size to inspect. Defaults to the largest size with any result.

Returns:
BenchmarkResult or None

The fastest cell at that size, or None if there are no results.

by_backend() dict[str, list[BenchmarkResult]][source]#

Group results by backend label, each list sorted by n_simulations.

speedups(baseline: str = 'sequential') dict[str, list[tuple[int, float]]][source]#

Speedup factors relative to baseline, as (n, factor) pairs.

Parameters:
baselinestr, default “sequential”

Backend label whose times define speedup = 1.0.

Returns:
dict[str, list[tuple[int, float]]]

Per-backend speedups at each size where both the backend and the baseline produced a usable (non-zero) time.

summary_table() str[source]#

Render a fixed-width execution-time + speedup summary (N/A for gaps).

to_dict() dict[str, Any][source]#

JSON-serializable view (system info, sizes, and result rows).

classmethod __new__(*args, **kwargs)#
__init__(results: list[~mcframework.benchmark.BenchmarkResult] = <factory>, sizes: list[int] = <factory>, system: dict[str, ~typing.Any] = <factory>) None#