For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
run
run[*, func1: def() raises -> None](num_warmup_iters: Int = 1, max_iters: Int = 1000000000, min_runtime_secs: Float64 = 0.10000000000000001, max_runtime_secs: Float64 = Float64("60"), max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_runtime_secs' has elapsed and either
max_runtime_secs OR max_iters is achieved.
Parameters:
- func1 (
def() raises -> None): The function to benchmark.
Args:
- num_warmup_iters (
Int): Number of warmup iterations. - max_iters (
Int): Max number of iterations to run (default1_000_000_000). - min_runtime_secs (
Float64): Lower bound on benchmarking time in secs (default0.1). - max_runtime_secs (
Float64): Upper bound on benchmarking time in secs (default60). - max_batch_size (
Int): The maximum number of iterations to perform per time measurement.
Returns:
Report: Average execution time of func in ns.
Raises:
If the operation fails.
run[*, func2: def() -> None](num_warmup_iters: Int = 1, max_iters: Int = 1000000000, min_runtime_secs: Float64 = 0.10000000000000001, max_runtime_secs: Float64 = Float64("60"), max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_runtime_secs' has elapsed and either
max_runtime_secs OR max_iters is achieved.
Parameters:
- func2 (
def() -> None): The function to benchmark.
Args:
- num_warmup_iters (
Int): Number of warmup iterations. - max_iters (
Int): Max number of iterations to run (default1_000_000_000). - min_runtime_secs (
Float64): Lower bound on benchmarking time in secs (default0.1). - max_runtime_secs (
Float64): Upper bound on benchmarking time in secs (default60). - max_batch_size (
Int): The maximum number of iterations to perform per time measurement.
Returns:
Report: Average execution time of func in ns.
Raises:
If the operation fails.
run[func3: def() raises capturing -> None](num_warmup_iters: Int = 1, max_iters: Int = 1000000000, min_runtime_secs: Float64 = 0.10000000000000001, max_runtime_secs: Float64 = Float64("60"), max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_runtime_secs' has elapsed and either
max_runtime_secs OR max_iters is achieved.
Parameters:
- func3 (
def() raises capturing -> None): The function to benchmark.
Args:
- num_warmup_iters (
Int): Number of warmup iterations. - max_iters (
Int): Max number of iterations to run (default1_000_000_000). - min_runtime_secs (
Float64): Lower bound on benchmarking time in secs (default0.1). - max_runtime_secs (
Float64): Upper bound on benchmarking time in secs (default60). - max_batch_size (
Int): The maximum number of iterations to perform per time measurement.
Returns:
Report: Average execution time of func in ns.
Raises:
If the operation fails.
run[*, func4: def() capturing -> None](num_warmup_iters: Int = 1, max_iters: Int = 1000000000, min_runtime_secs: Float64 = 0.10000000000000001, max_runtime_secs: Float64 = Float64("60"), max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_runtime_secs' has elapsed and either
max_runtime_secs OR max_iters is achieved.
Parameters:
- func4 (
def() capturing -> None): The function to benchmark.
Args:
- num_warmup_iters (
Int): Number of warmup iterations. - max_iters (
Int): Max number of iterations to run (default1_000_000_000). - min_runtime_secs (
Float64): Lower bound on benchmarking time in secs (default0.1). - max_runtime_secs (
Float64): Upper bound on benchmarking time in secs (default60). - max_batch_size (
Int): The maximum number of iterations to perform per time measurement.
Returns:
Report: Average execution time of func in ns.
Raises:
If the operation fails.