Runner

mew.run(entries=None, *, argv=None, reporter=None, filter=None, session_tag=None)[source]

Run benchmarks via the C++ Google Benchmark backend.

Each call is one session: a fresh time-ordered session_id is stamped into the reporter context, so result files stay addressable when several runs land in one archive.

Parameters:
  • entries (Sequence[Entry] | None) – Benchmarks to run. None runs everything in the global registry; pass a filtered subset (e.g. from Registry.filter()) to scope a run.

  • argv (Sequence[str] | None) – Argv forwarded to Google Benchmark’s Initialize. Defaults to ["mew"].

  • reporter (Reporter | Iterable[Reporter] | None) – A single reporter, an iterable of reporters (multiplexed via Fanout), or None for Google Benchmark’s default console reporter.

  • filter (str | None) – Regex forwarded to Google Benchmark as --benchmark_filter=.

  • session_tag (str | None) – Human label for this session (e.g. "before"), persisted next to session_id in the reporter context.

Return type:

int

Returns:

int – Number of benchmarks Google Benchmark executed. 0 if no entries were selected.

For lower-level entry points, see :mod:mew.runner:

Bridge between the Python registry and the C++ runner.