Benchit Documentation¶
Note
This package is under active development. API changes are very likely.
Installation¶
Latest PyPI stable release (alongwith dependencies) :
pip install benchit
Pull latest development release on GitHub and install in the current directory :
pip install -e git+https://github.com/droyed/benchit.git@master#egg=benchit
Quick start¶
Let’s benchmark NumPy ufuncs - sum, prod, max on 1D arrays -
# Setup input functions and datasets
>>> import numpy as np
>>> funcs = [np.sum,np.prod,np.max]
>>> inputs = [np.random.rand(i) for i in 10**np.arange(5)]
# Benchmark and plot
>>> import benchit
>>> t = benchit.timings(funcs, inputs)
>>> t.plot(logy=True, logx=True, save='index_timings.png')
Though these perform entirely different operations, it was meant to showcase a basic usage. For a detailed explanation on the usage and more realistic scenarios, jump over to - Benchmarking steps.