simplebench.stats.memory_usage module🔗

Containers for benchmark statistics

class simplebench.stats.memory_usage.MemoryUsage(
*,
iterations: Sequence[Iteration] | None = None,
unit: str = 'bytes',
scale: float = 1.0,
rounds: int = 1,
data: Sequence[int | float] | None = None,
)[source]🔗

Bases: Stats

Container for the memory usage statistics of a benchmark.

Variables:
  • unit (str) – The unit of measurement for the memory usage (e.g., “MB”).

  • scale (float) – The scale factor for the memory usage (e.g., “1e6” for megabytes).

  • rounds (int) – The number of data points in the benchmark.

  • data (tuple[float | int, ...]) – Tuple of memory usage data points.

  • mean (float) – The mean memory usage.

  • median (float) – The median memory usage.

  • minimum (float) – The minimum memory usage.

  • maximum (float) – The maximum memory usage.

  • standard_deviation (float) – The standard deviation of the memory usage.

  • relative_standard_deviation (float) – The relative standard deviation of the memory usage.

  • percentiles (dict[int, float]) – Percentiles of memory usage.

class simplebench.stats.memory_usage.MemoryUsageSummary(
*,
unit: str,
scale: float,
rounds: int,
mean: float,
median: float,
minimum: float,
maximum: float,
standard_deviation: float,
relative_standard_deviation: float,
percentiles: tuple[float, ...],
)[source]🔗

Bases: StatsSummary

Container for summary statistics of a MemoryUsage benchmark.

This class is exclusive of raw data points.

Variables:
  • unit (str) – The unit of measurement for the benchmark (e.g., “ops/s”).

  • scale (float) – The scale factor for the interval (e.g. 1 for seconds).

  • rounds (int) – The number of data points in the benchmark.

  • data (tuple[int | float, ...]) – Always an empty tuple as a StatsSummary object does not contain raw data points.

  • mean (float) – The mean operations per time interval.

  • median (float) – The median operations per time interval.

  • minimum (float) – The minimum operations per time interval.

  • maximum (float) – The maximum operations per time interval.

  • standard_deviation (float) – The standard deviation of operations per time interval.

  • relative_standard_deviation (float) – The relative standard deviation of ops per time interval.

  • percentiles (tuple[float, ...]) – Percentiles of operations per time interval.