simplebench.reporters.graph.scatterplot.reporter module🔗

Reporter for benchmark results using graphs.

class simplebench.reporters.graph.scatterplot.reporter.ScatterPlotReporter(
config: ScatterPlotConfig | None = None,
)[source]🔗

Bases: MatPlotLibReporter

Class for outputting benchmark results as scatter plot graphs.

This reporter generates scatter plot visualizations for various result sections, saving them to the filesystem or passing them to a callback function. It provides a visual way to compare the performance of different benchmark variations.

Defined command-line flags:

  • --scatter-plot: {filesystem, callback} (default=filesystem)

  • --scatter-plot.ops: ...

  • --scatter-plot.timings: ...

  • --scatter-plot.memory: ...

Example usage:

program.py --scatter-plot               # Outputs graphs to the filesystem.
program.py --scatter-plot.ops filesystem  # Outputs only ops graphs to the filesystem.
render(
*,
case: Case,
section: Section,
options: ReporterOptions,
) bytes[source]🔗

Render the scatter plot graph and return it as bytes.

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

  • section – The section of the results to plot.

  • options – The options for rendering the scatter plot.

Returns:

The rendered graph as bytes. The format is determined by the options. The defaults are defined in ScatterPlotOptions.

Raises: