funcmeasure
Project description
funcmeasure
Todo
- Clean up code because it's messy af
- Add support for easier creation of partials
Description
Measure and compare function execution times
Install
pip install funcmeasure
# or
pip3 install funcmeasure
Usage
from funcmeasure import measure, partial, Measurement
def f1():
5**2
def f2():
5**2**10
measurements = measure([f1, f2], times=1000, print_benchmark=True)
This will print:
Ran 1000 times
-----------------------------------------
| rank | name | duration | benchmark |
-----------------------------------------
| 1 | f1 | 0.00000023s | |
| 2 | f2 | 0.00000259s | 11.31x |
-----------------------------------------
Notes
The lib also provides a helper function for partials, so you don't have to import functools
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
funcmeasure-0.0.3.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for funcmeasure-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 414555441fd52293080f56e04c995b876cb9137a369ba77e60e55fae7f4a228c |
|
MD5 | 79d7f266c2b53b86438cd2624a12b7a4 |
|
BLAKE2b-256 | 29409ae33a765cc0e8145347ee6b9cdbe2f27ddbf40c2616d0181ff8fb3b0b9b |