Registry

The registry is the process-global collection of registered benchmarks. Decorators add to it; the runner reads from it.

class mew.Registry[source]

Bases: object

add(entry)[source]
Return type:

None

Parameters:

entry (Entry)

clear()[source]
Return type:

None

all()[source]
Return type:

list[Entry]

filter(pattern=None, *, tags=None)[source]

Filter by pattern (a regex matched against the name) and/or tags.

A pattern that matches only some cases of a parametrized family narrows that family to those cases (see narrow_entry()). Tags use OR semantics: an entry passes when it has any of the requested tags; entries with no tags are excluded whenever tags is non-empty. Raises ValueError if pattern is not a valid regex.

Return type:

list[Entry]

Parameters:
class mew.Entry(name, fn, module=None, file=None, options=<factory>, tags=<factory>, case_labels=None, cases=None)[source]

Bases: object

Parameters:
name: str
fn: BenchmarkFn
module: str | None
file: str | None
options: BenchmarkOptions
tags: frozenset[str]
case_labels: list[str] | None
cases: list[int] | None
mew.REGISTRY

The shared Registry instance populated by decorators.