simplebench.reporters.rich_table.reporter.reporter module🔗
Reporter for benchmark results using Rich tables on the console.
- class simplebench.reporters.rich_table.reporter.reporter.RichTableReporter(
- config: RichTableConfig | None = None,
Bases:
ReporterClass for outputting benchmark results as Rich Tables.
It supports reporting operations per second and per round timing results, either separately or together, to the console, to files, and/or via a callback function.
Defined command-line flags:
--rich-table: Outputs all results as rich text tables on the console.--rich-table.ops: Outputs only operations per second results.--rich-table.timings: Outputs only per round timing results.--rich-table.memory: Outputs only memory usage results.--rich-table.peak-memory: Outputs only peak memory usage results.
Each flag supports multiple targets:
console,filesystem, andcallbackwith the default target beingconsole.- Variables:
name (str) – The unique identifying name of the reporter.
description (str) – A brief description of the reporter.
choices (Choices) – A collection of
Choicesinstances defining the reporter instance, CLI flags,Choicename, supportedSectionobjects, supported outputTargetobjects, and supported outputFormatobjects for the reporter.
- render(
- *,
- case: Case,
- section: Section,
- options: ReporterOptions,
Prints the benchmark results in a rich table format if available.
It creates a
Tableinstance containing the benchmark results for the specified section.- Parameters:
case – The
Caseinstance representing the benchmarked code.options – The options specifying the report configuration. (
RichTableOptionsis a subclass ofReporterOptions.)section – The
Sectionenum value specifying the type of results to display.
- Returns:
The
Tableinstance.