lacuna.benchmark
Reproducible developer benchmarks.
Generated from Lacuna 0.14.3.
Classes
BenchmarkCase
class BenchmarkCase(
name: str,
backend: str,
median_seconds: float,
minimum_seconds: float,
maximum_seconds: float,
throughput: float,
throughput_unit: str,
python_traced_peak_bytes: int,
checksum: str,
) One measured public operation with an equivalence checksum.
| Field | Type | Default |
|---|---|---|
name | str | required |
backend | str | required |
median_seconds | float | required |
minimum_seconds | float | required |
maximum_seconds | float | required |
throughput | float | required |
throughput_unit | str | required |
python_traced_peak_bytes | int | required |
checksum | str | required |
BenchmarkCase.to_dict
def to_dict() -> dict[str, object] Return a JSON-compatible measurement record.
BenchmarkConfig
class BenchmarkConfig(
periods: int = 40,
instruments: int = 100,
horizons: tuple[int, ...] = (1, 5, 20),
quantiles: int = 5,
bootstrap_resamples: int = 200,
repetitions: int = 3,
warmups: int = 1,
seed: int = 42,
) Deterministic dataset and measurement configuration.
| Field | Type | Default |
|---|---|---|
periods | int | 40 |
instruments | int | 100 |
horizons | tuple[int, ...] | (1, 5, 20) |
quantiles | int | 5 |
bootstrap_resamples | int | 200 |
repetitions | int | 3 |
warmups | int | 1 |
seed | int | 42 |
BenchmarkConfig.rows
rows: int Return rows in each generated panel.
BenchmarkConfig.horizon_names
horizon_names: tuple[str, ...] Return public trading-observation horizon names.
BenchmarkConfig.to_dict
def to_dict() -> dict[str, object] Return JSON-compatible resolved configuration.
BenchmarkSuite
class BenchmarkSuite(
config: BenchmarkConfig,
cases: tuple[BenchmarkCase, ...],
generated_at: datetime,
environment: Mapping[str, object],
schema_version: str = '1',
benchmark_version: int = 6,
) Versioned benchmark artifact; timings are environment-specific evidence.
| Field | Type | Default |
|---|---|---|
config | BenchmarkConfig | required |
cases | tuple[BenchmarkCase, ...] | required |
generated_at | datetime | required |
environment | Mapping[str, object] | required |
schema_version | str | '1' |
benchmark_version | int | 6 |
BenchmarkSuite.to_dict
def to_dict() -> dict[str, object] Return the complete benchmark artifact.
BenchmarkSuite.to_json
def to_json(*, indent: int | None = 2) -> str Serialize with stable key ordering.
Functions
benchmark_config_for_tier
def benchmark_config_for_tier(
tier: str,
*,
repetitions: int = 3,
warmups: int = 1,
seed: int = 42,
) -> BenchmarkConfig Resolve the committed smoke/small/medium benchmark tiers.
run_benchmarks
def run_benchmarks(
config: BenchmarkConfig | None = None,
*,
use_native: bool = True,
) -> BenchmarkSuite Measure released public workflows without enforcing machine-specific speed budgets.