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,
)[source]🔗

Bases: Reporter

Class 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, and callback with the default target being console.

Variables:
  • name (str) – The unique identifying name of the reporter.

  • description (str) – A brief description of the reporter.

  • choices (Choices) – A collection of Choices instances defining the reporter instance, CLI flags, Choice name, supported Section objects, supported output Target objects, and supported output Format objects for the reporter.

render(
*,
case: Case,
section: Section,
options: ReporterOptions,
) Table[source]🔗

Prints the benchmark results in a rich table format if available.

It creates a Table instance containing the benchmark results for the specified section.

Parameters:
  • case – The Case instance representing the benchmarked code.

  • options – The options specifying the report configuration. (RichTableOptions is a subclass of ReporterOptions.)

  • section – The Section enum value specifying the type of results to display.

Returns:

The Table instance.