Skip to main content

A simple benchmarking package.

Project description

A simple benchmarking package.

Installation

Using pip:

pip install simple_benchmark

Or the manual installation using git:

git clone https://github.com/MSeifert04/simple_benchmark.git
cd simple_benchmark
python setup.py install

Getting started

Suppose you want to compare how NumPys sum and Pythons sum perform on lists of different sizes:

>>> from simple_benchmark import benchmark
>>> import numpy as np
>>> funcs = [sum, np.sum]
>>> arguments = {i: [1]*i for i in [1, 10, 100, 1000, 10000, 100000]}
>>> argument_name = 'list size'
>>> aliases = {sum: 'Python sum', np.sum: 'NumPy sum'}
>>> b = benchmark(funcs, arguments, argument_name, function_aliases=aliases)

The result can be visualized with pandas (needs to be installed):

>>> b
        NumPy sum    Python sum
1        0.000003  1.032715e-07
10       0.000004  1.569619e-07
100      0.000007  7.155641e-07
1000     0.000042  6.153851e-06
10000    0.000382  6.030774e-05
100000   0.004034  6.026672e-04

Or with matplotlib (has to be installed too):

>>> b.plot()
./docs/source/sum_example.png

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

simple_benchmark-0.0.3.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file simple_benchmark-0.0.3.tar.gz.

File metadata

File hashes

Hashes for simple_benchmark-0.0.3.tar.gz
Algorithm Hash digest
SHA256 855c8402af67297cd7e8cb5310df6d4a4ef63da102fd8e18fd87b18204cfe3b7
MD5 1ae2750b1fef932d59e8532d3e89fde6
BLAKE2b-256 5aa8e3bb54e1e7c2aa44b83efebc6eb3bc5d65b4520ad2b070ab15be340e7927

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page