Statistics-driven Microbenchmarking in Python
Pyterion is a Python library that provides utilities to benchmark and analyse performance.
To benchmark a function, you can use the benchmark
decorator.
import time
from pyterion import benchmark
@benchmark
def function():
time.sleep(0.001)
Or alternatively
import time
from pyterion import benchmark
def function():
time.sleep(0.001)
benchmark(function)
The above code below will produce the following output among other statistics and visualisations.
- criterion.rs - The Rust microbenchmarking library that pyterion is based on
- criterion - The Haskell microbenchmarking library that inspired criterion.rs