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,
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.
Initialize the ScatterPlotReporter.
Note
The exception documentation below refers to validation of subclass configuration class variables
_OPTIONS_TYPEand_OPTIONS_KWARGS. These must be correctly defined in any subclass ofScatterPlotReporterto 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:
SimpleBenchTypeError – If the subclass configuration types are invalid.
SimpleBenchValueError – If the subclass configuration values are invalid.
- 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.