Metadata-Version: 1.1
Name: pybenchmarks
Version: 1.0
Summary: Automate benchmark tables
Home-page: http://pchanial.github.com/pybenchmarks
Author: Pierre Chanial
Author-email: pierre.chanial@gmail.com
License: UNKNOWN
Description: ===========
        PyBenchmark
        ===========
        
        Automate the creation of benchmark tables.
        
        The benchmark function times a code snippet by iterating through sequences of
        input arguments and keywords. It returns a dictionary containing the elapsed
        time and memory usage for each benchmark.
        
        
        ========
        Examples
        ========
        
        >>> import numpy as np
        >>> def f(dtype, n=10):
        ...     return np.zeros(n, dtype)
        >>> b = benchmark(f, (int, float), n=(10, 100))
        <type 'int'>,n=10: 1000000 loops, best of 3: 1.52 us per loop.  VmData:0.0MiB, VmSize:0.0MiB, VmRSS:0.00390625MiB
        <type 'int'>,n=100: 1000000 loops, best of 3: 1.69 us per loop.  VmData:0.0MiB, VmSize:0.0MiB, VmRSS:0.0MiB
        <type 'float'>,n=10: 1000000 loops, best of 3: 1.53 us per loop.  VmData:0.0MiB, VmSize:0.0MiB, VmRSS:0.0MiB
        <type 'float'>,n=100: 1000000 loops, best of 3: 1.7 us per loop.  VmData:0.0MiB, VmSize:0.0MiB, VmRSS:0.0MiB
        
        
        >>> benchmark('sleep(1)', setup='from time import sleep')
        
        >>> shapes = (10, 100, 1000)
        >>> b = benchmark('np.dot(a, a)', shapes,
        ...               setup='import numpy as np;'
        ...                     'a = np.random.random_sample(*args)')
        
        >>> b = benchmark('np.dot(a, a)', size=shapes,
        ...               setup='import numpy as np;'
        ...                     'a = np.random.random_sample(**keywords)')
        
        >>> b = benchmark('np.dot(a, b)', shapes, shapes,
        ...               setup='import numpy as np;'
        ...                     'm, n = *args;'
        ...                     'a = np.random.random_sample((m, n));'
        ...                     'b = np.random.random_sample(n)')
        
        >>> class A():
        ...     def __init__(self, dtype, n=10):
        ...         self.a = 2 * np.ones(n, dtype)
        ...     def run(self):
        ...         np.sqrt(self.a)
        >>> b = benchmark('a.run()', ('int', 'float'), n=(1, 10),
        ...               setup='from __main__ import A; a=A(*args, **keywords)')
        
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: Public Domain
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
