/pyterion

Statistics-driven benchmarking library for Python

Primary LanguageRustMIT LicenseMIT

Pyterion

Statistics-driven Microbenchmarking in Python
Build status License: MIT Code style: black

Pyterion is a Python library that provides utilities to benchmark and analyse performance.


Example

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.

Example Benchmark Example Benchmark

Related projects

  • criterion.rs - The Rust microbenchmarking library that pyterion is based on
  • criterion - The Haskell microbenchmarking library that inspired criterion.rs