{ "info": { "author": "Pierre Chanial", "author_email": "pierre.chanial@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: Public Domain", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development" ], "description": "============\nPyBenchmarks\n============\n\nAutomate the creation of benchmark tables.\n\nThe benchmark utility times one or more code snippets or functions by iterating\nthrough input arguments or keyed variables. It returns a dictionary\ncontaining the elapsed time (all platforms) and memory usage (linux only)\nfor each combination of the input variables. An argument or keyed variable\nis iterated if and only if it is a list, a tuple, a generator or a range.\n\n\n========\nExamples\n========\n\n>>> import numpy as np\n>>> from pybenchmarks import benchmark\n>>> b = benchmark((np.empty, np.ones), (100, 10000, 1000000),\n... dtype=(int, complex))\nempty: 100 dtype=int 1.62 us\nones : 100 dtype=int 3.61 us\nempty: 100 dtype=complex 1.70 us\nones : 100 dtype=complex 5.42 us\nempty: 10000 dtype=int 1.53 us\nones : 10000 dtype=int 7.53 us\nempty: 10000 dtype=complex 2.33 us\nones : 10000 dtype=complex 16.29 us\nempty: 1000000 dtype=int 1.87 us\nones : 1000000 dtype=int 1.84 ms\nempty: 1000000 dtype=complex 2.19 us\nones : 1000000 dtype=complex 4.20 ms\n\n>>> b = benchmark(['np.empty(n, dtype=dtype)', 'np.ones(n, dtype=dtype)'],\n... dtype=(int, complex), n=(100, 10000, 1000000),\n... setup='from __main__ import np')\n'np.empty(n, dt...: dtype=int n=100 1.36 us\n'np.ones(n, dty...: dtype=int n=100 2.83 us\n'np.empty(n, dt...: dtype=complex n=100 1.44 us\n'np.ones(n, dty...: dtype=complex n=100 3.50 us\n'np.empty(n, dt...: dtype=int n=10000 1.22 us\n'np.ones(n, dty...: dtype=int n=10000 7.05 us\n'np.empty(n, dt...: dtype=complex n=10000 1.35 us\n'np.ones(n, dty...: dtype=complex n=10000 23.78 us\n'np.empty(n, dt...: dtype=int n=1000000 1.47 us\n'np.ones(n, dty...: dtype=int n=1000000 2.04 ms\n'np.empty(n, dt...: dtype=complex n=1000000 2.91 us\n'np.ones(n, dty...: dtype=complex n=1000000 4.26 ms\n\n>>> import time\n>>> benchmark(time.sleep, (1, 2, 3))\n1 1.00 s\n2 2.00 s\n3 3.00 s\n\n>>> shapes = (100, 10000, 1000000)\n>>> setup = \"\"\"\n... import numpy as np\n... a = np.random.random_sample(shape)\n... \"\"\"\n>>> b = benchmark('np.dot(a, a)', shape=shapes, setup=setup)\nshape=100 1.38 us\nshape=10000 6.33 us\nshape=1000000 855.44 us\n\n>>> shapes = (10, 100, 1000)\n>>> setup=\"\"\"\n... import numpy as np\n... a = np.random.random_sample((m, n))\n... b = np.random.random_sample(n)\n... \"\"\"\n>>> b = benchmark('np.dot(a, b)', m=shapes, n=shapes, setup=setup)\nm=10 n=10 1.08 us\nm=100 n=10 1.61 us\nm=1000 n=10 6.91 us\nm=10 n=100 1.48 us\nm=100 n=100 4.16 us\nm=1000 n=100 20.69 us\nm=10 n=1000 4.42 us\nm=100 n=1000 39.23 us\nm=1000 n=1000 931.04 us\n\n>>> def f(x, n, start=1):\n... out = start\n... for i in range(n):\n... out *= x\n... return out\n>>> b = benchmark(f, np.full(10, 2), xrange(10), start=2.)\n0 1.09 us\n1 4.15 us\n2 5.25 us\n3 5.53 us\n4 13.10 us\n5 9.23 us\n6 9.69 us\n7 10.46 us\n8 13.03 us\n9 10.77 us", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/pchanial/pybenchmarks", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pybenchmarks", "package_url": "https://pypi.org/project/pybenchmarks/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pybenchmarks/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/pchanial/pybenchmarks" }, "release_url": "https://pypi.org/project/pybenchmarks/2.4/", "requires_dist": null, "requires_python": null, "summary": "Automate benchmark tables", "version": "2.4" }, "last_serial": 1440142, "releases": { "2.4": [ { "comment_text": "", "digests": { "md5": "e91b689698682ed2a2721a58a18bf458", "sha256": "11e6c82dc1599f9b6b9b505f79760a58d8a12d12b0bb73a7052a1da41ca413f6" }, "downloads": -1, "filename": "pybenchmarks-2.4.tar.gz", "has_sig": false, "md5_digest": "e91b689698682ed2a2721a58a18bf458", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5619, "upload_time": "2015-02-26T22:01:25", "url": "https://files.pythonhosted.org/packages/11/ad/c215267b7ef08b65b4fe7ada9a71384f0bd205f740f98f1f3a69ffd33c3e/pybenchmarks-2.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e91b689698682ed2a2721a58a18bf458", "sha256": "11e6c82dc1599f9b6b9b505f79760a58d8a12d12b0bb73a7052a1da41ca413f6" }, "downloads": -1, "filename": "pybenchmarks-2.4.tar.gz", "has_sig": false, "md5_digest": "e91b689698682ed2a2721a58a18bf458", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5619, "upload_time": "2015-02-26T22:01:25", "url": "https://files.pythonhosted.org/packages/11/ad/c215267b7ef08b65b4fe7ada9a71384f0bd205f740f98f1f3a69ffd33c3e/pybenchmarks-2.4.tar.gz" } ] }