-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPKG-INFO
More file actions
97 lines (75 loc) · 3.8 KB
/
PKG-INFO
File metadata and controls
97 lines (75 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Metadata-Version: 1.0
Name: benchmark
Version: 0.1.5
Summary: Python benchmarker / benchmarking framework
Home-page: http://jspi.es/benchmark
Author: Jeffrey R. Spies
Author-email: jspies@gmail.com
License: LICENSE.txt
Description: =========
benchmark
=========
``benchmark`` is a Python benchmarking framework, similar to Steve Purcell's
``unittest`` in basic structure. It's as simple as::
import benchmark
import math
class Benchmark_Sqrt(benchmark.Benchmark):
each = 100 # allows for differing number of runs
def setUp(self):
# Only using setUp in order to subclass later
# Can also specify tearDown, eachSetUp, and eachTearDown
self.size = 25000
def test_pow_operator(self):
for i in xrange(self.size):
z = i**.5
def test_pow_function(self):
for i in xrange(self.size):
z = pow(i, .5)
def test_sqrt_function(self):
for i in xrange(self.size):
z = math.sqrt(i)
class Benchmark_Sqrt2(Benchmark_Sqrt):
# Subclass the previous benchmark to change input using
# self.setUp()
label = "Benchmark Sqrt on a larger range"
# The above label comes from the class name, this oen
# comes from the label attribute
each = 50
def setUp(self):
self.size = 750000
if __name__ == '__main__':
benchmark.main(format="markdown", numberFormat="%.4g")
# could have written benchmark.main(each=50) if the
# first class shouldn't have been run 100 times.
which produces::
Benchmark Report
================
Benchmark Sqrt
--------------
name | rank | runs | mean | sd | timesBaseline
--------------|------|------|----------|-----------|--------------
pow operator | 1 | 100 | 0.004163 | 0.0001469 | 1.0
sqrt function | 2 | 100 | 0.004584 | 0.000379 | 1.10126499627
pow function | 3 | 100 | 0.005496 | 0.0002709 | 1.32031909568
Benchmark Sqrt on a larger range
--------------------------------
name | rank | runs | mean | sd | timesBaseline
--------------|------|------|--------|----------|--------------
pow operator | 1 | 50 | 0.1265 | 0.004772 | 1.0
sqrt function | 2 | 50 | 0.1375 | 0.004729 | 1.08705384
pow function | 3 | 50 | 0.1649 | 0.003935 | 1.30357975885
Each of the above 450 runs were run in random, non-consecutive order by
`benchmark` v0.1.4 (http://jspi.es/benchmark) with Python 2.7.1
Darwin-11.3.0-x86_64 on 2012-04-17 19:43:01.
More examples are available in the example folder or visit
http://jspi.es/benchmark for more information.
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: System :: Benchmark