summaryrefslogtreecommitdiff
path: root/benchmarks/creating.py
blob: 6f8dc0217cc7a167f8b08b44331482ada325ccb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from benchmark import Benchmark

modules = ['numpy','Numeric','numarray']

N = [10,10]
b = Benchmark(modules,
              title='Creating %s zeros.' % N,
              runs=3,reps=10000)

b['numpy'] = ('a=np.zeros(shape,type)', 'shape=%s;type=float' % N)
b['Numeric'] = ('a=np.zeros(shape,type)', 'shape=%s;type=np.Float' % N)
b['numarray'] = ('a=np.zeros(shape,type)', "shape=%s;type=np.Float" % N)

b.run()