Python API

Top-level re-exports

The public surface lives at the package root. All names below are importable from mew directly:

benchmark([fn, name, tags])

parametrize(parameters, *[, name, ids, tags])

Register a parametrized benchmark family.

product(*[, name, ids, tags, min_time, ...])

Register a benchmark family from the cartesian product of iterables.

State(*args, **kwargs)

Structural state passed into benchmark targets.

BenchmarkFn(*args, **kwargs)

A callable benchmark target.

run([entries, argv, reporter, filter, ...])

Run benchmarks via the C++ Google Benchmark backend.

Reporter(*args, **kwargs)

Duck-typed reporter interface consumed by the C++ runner.

RichReporter(*[, console, show_memory, ...])

Stream one row per benchmark to a terminal as runs complete.

JSONReporter(*[, output])

Emit a single {"context": ..., "benchmarks": [...]} document, GB-style.

ParquetReporter(*, output[, append])

Write a Parquet file with one row per benchmark Run.

Fanout(reporters)

Broadcast reporter callbacks to a list of underlying reporters.

Run

A single benchmark run report.

RunType(*values)

Distinguishes per-repetition runs from aggregate (mean / median / stddev) rows.

TimeUnit(*values)

Time unit used for reported per-iteration durations.

BenchmarkHandle

Handle to a registered Google Benchmark.

Registry()

Entry(name, fn[, module, file, options, ...])

REGISTRY

BENCHMARK_VERSION

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

BENCHMARK_COMMIT

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

set_context(key, value)

Set a single value in the global benchmark context.

update_context(*mapping, **kwargs)

Set many context values at once.

get_context()

Return a deep copy of the current global benchmark context.

clear_context()

Drop every entry from the global benchmark context.