[Numpy-discussion] numpy vs numeric benchmarks

RayS rays at blue-cove.com
Fri Jun 2 09:27:27 CDT 2006


favorable
numpy creates arrays much faster, fft seems a tad faster
a useful metric, I think, for O-scope and ADC apps

I get
0.0039054614015815738
0.0019759541205486885

0.023268623246481726
0.0023570392204637913
from the below on a PIII 600...


from time import *
n=4096
r = range(n)

#numpy
import numpy
arr = numpy.array
# array creation
t0 = clock()
for i in r:
   a = arr(r)

(clock()-t0)/float(n)
#fft of n
fftn = numpy.fft
t0 = clock()
for i in r:
   f = fftn(a)

(clock()-t0)/float(n)



#Numeric
import Numeric
arr = Numeric.array
# array creation
t0 = clock()
for i in r:
   a = arr(r)

(clock()-t0)/float(n)
#fft of n
from FFT import *
t0 = clock()
for i in r:
   f = fft(a)

(clock()-t0)/float(n)





More information about the Numpy-discussion mailing list