simplebench.reporters.graph.scatterplot.reporter module🔗
Reporter for benchmark results using graphs.
- class simplebench.reporters.graph.scatterplot.reporter.ScatterPlotReporter(
- config: ScatterPlotConfig | None = None,
Bases:
MatPlotLibReporterClass 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,
Render the scatter plot graph and return it as bytes.
- Parameters:
case – The
Caseinstance 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:
SimpleBenchTypeError – If the provided arguments are not of the expected types or values.
SimpleBenchValueError – If the provided values are not valid.