summaryrefslogtreecommitdiff
path: root/benchmarks/creating.py
blob: 981c7fe471ef2f47ee166ea4044d8f894f1d1e85 (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=N.zeros(shape,type)', 'shape=%s;type=float' % N)
b['Numeric'] = ('a=N.zeros(shape,type)', 'shape=%s;type=N.Float' % N)
b['numarray'] = ('a=N.zeros(shape,type)', "shape=%s;type=N.Float" % N)

b.run()