Skip to main content

struct

Report

Contains the average execution time, iterations, min and max of each batch.

Fields

  • warmup_iters (Int): The total warmup iterations.
  • warmup_duration (Int): The total duration it took to warmup.
  • runs (List[Batch]): A List of benchmark runs.

Implemented traits

AnyType, CollectionElement, Copyable, Movable

Methods

__init__

__init__(inout self: Self, /)

Default initializer for the Report.

Sets all values to 0

__copyinit__

__copyinit__(inout self: Self, /, existing: Self)

Creates a shallow copy (it doesn't copy the data).

Args:

  • existing (Self): The Report to copy.

iters

iters(self: Self) -> Int

The total benchmark iterations.

Returns:

The total benchmark iterations.

duration

duration(self: Self, unit: String = "s") -> SIMD[float64, 1]

The total duration it took to run all benchmarks.

Args:

  • unit (String): The time unit to display for example: ns, ms, s (default s).

Returns:

The total duration it took to run all benchmarks.

mean

mean(self: Self, unit: String = "s") -> SIMD[float64, 1]

The average duration of all benchmark runs.

Args:

  • unit (String): The time unit to display for example: ns, ms, s (default s).

Returns:

The average duration of all benchmark runs.

min

min(self: Self, unit: String = "s") -> SIMD[float64, 1]

The batch of benchmarks that was the fastest to run.

Args:

  • unit (String): The time unit to display for example: ns, ms, s (default s).

Returns:

The fastest duration out of all batches.

max

max(self: Self, unit: String = "s") -> SIMD[float64, 1]

The batch of benchmarks that was the slowest to run.

Args:

  • unit (String): The time unit to display for example: ns, ms, s (default s).

Returns:

The slowest duration out of all batches.

print

print(self: Self, unit: String = "s")

Prints out the shortened version of the report.

Args:

  • unit (String): The time unit to display for example: ns, ms, s (default s).

print_full(self: Self, unit: String = "s")

Prints out the full version of the report with each batch of benchmark runs.

Args:

  • unit (String): The time unit to display for example: ns, ms, s (default s).