simplebench.reporters.graph.scatterplot package🔗
ScatterPlot graph.scatterplot sub-package in the reporters package.
- class simplebench.reporters.graph.scatterplot.ScatterPlotConfig(
- *,
- name: str | None = None,
- description: str | None = None,
- sections: Iterable[Section] | None = None,
- targets: Iterable[Target] | None = None,
- default_targets: Iterable[Target] | None = None,
- formats: Iterable[Format] | None = None,
- choices: ChoicesConf | None = None,
- file_suffix: str | None = None,
- file_unique: bool | None = None,
- file_append: bool | None = None,
- subdir: str | None = None,
Bases:
ReporterConfigConfiguration for a ScatterPlotReporter.
This class inherits from
ReporterConfigand provides a type-safe, discoverable interface for overriding the default settings of aScatterPlotReporter.
- class simplebench.reporters.graph.scatterplot.ScatterPlotOptions(
- width: int | None = None,
- height: int | None = None,
- dpi: int | None = None,
- y_starts_at_zero: bool | None = None,
- x_labels_rotation: float | None = None,
- style: Style | None = None,
- theme: Theme | None = None,
- image_type: ImageType | None = None,
Bases:
MatPlotLibOptionsScatter Plot options.
Defaults are inherited from
MatPlotLibOptions:width: int = 1500height: int = 750dpi: int = 150y_starts_at_zero: bool = Truex_labels_rotation: float = 45.0style: Style = Style.DARK_BACKGROUNDtheme: Theme = Theme.Defaultimage_type: ImageType = ImageType.SVG
- class simplebench.reporters.graph.scatterplot.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.