simplebench.reporters.graph.scatterplot.reporter.reporter module🔗

Reporter for benchmark results using graphs.

class simplebench.reporters.graph.scatterplot.reporter.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.

Initialize the ScatterPlotReporter.

Note

The exception documentation below refers to validation of subclass configuration class variables _OPTIONS_TYPE and _OPTIONS_KWARGS. These must be correctly defined in any subclass of ScatterPlotReporter to ensure proper functionality.

Parameters:

config (ScatterPlotConfig | None) – An optional configuration object to override default reporter settings. If not provided, default settings will be used.

Raises:
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: