Mojo struct
Report
struct Report
Contains the average execution time, iterations, min and max of each batch.
Fields
- warmup_duration (
Int
): The total duration it took to warmup. - runs (
List[Batch]
): AList
of benchmark runs.
Implemented traits
AnyType
,
CollectionElement
,
Copyable
,
ExplicitlyCopyable
,
Movable
,
UnknownDestructibility
Methods
__init__
__init__(out self)
Default initializer for the Report.
Sets all values to 0
__init__(out self, *, other: Self)
Explicitly construct a deep copy of the provided value.
Args:
- other (
Self
): The value to copy.
__copyinit__
__copyinit__(out self, existing: Self)
Creates a shallow copy (it doesn't copy the data).
Args:
- existing (
Self
): TheReport
to copy.
iters
iters(self) -> Int
The total benchmark iterations.
Returns:
The total benchmark iterations.
duration
duration(self, unit: String = 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 (defaults
).
Returns:
The total duration it took to run all benchmarks.
mean
mean(self, unit: String = 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 (defaults
).
Returns:
The average duration of all benchmark runs.
min
min(self, unit: String = 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 (defaults
).
Returns:
The fastest duration out of all batches.
max
max(self, unit: String = 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 (defaults
).
Returns:
The slowest duration out of all batches.
print
print(self, unit: String = String("s"))
Prints out the shortened version of the report.
Args:
- unit (
String
): The time unit to display for example: ns, ms, s (defaults
).
print_full
print_full(self, unit: String = 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 (defaults
).
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!