summaryrefslogtreecommitdiff
path: root/benchmarks/creating.py
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/creating.py')
-rw-r--r--benchmarks/creating.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/benchmarks/creating.py b/benchmarks/creating.py
new file mode 100644
index 000000000..b8bb30f47
--- /dev/null
+++ b/benchmarks/creating.py
@@ -0,0 +1,9 @@
+import timeit
+N = [1000,100]
+t1 = timeit.Timer('a=N.zeros(shape,type)','import numpy as N; shape=%s;type=float'%N)
+t2 = timeit.Timer('a=N.zeros(shape,type)','import Numeric as N; shape=%s;type=N.Float'%N)
+t3 = timeit.Timer('a=N.zeros(shape,type)',"import numarray as N; shape=%s;type=N.Float"%N)
+print "shape = ", N
+print "NumPy: ", t1.repeat(3,100)
+print "Numeric: ", t2.repeat(3,100)
+print "Numarray: ", t3.repeat(3,100)