[Numpy-discussion] numpy speed question
Thu Nov 25 04:13:49 CST 2010
I have a little question about the speed of numpy vs IDL 7.0. I did a
very simple little check by computing just a cosine in a loop. I was
quite surprised to see an order of magnitude of difference between numpy
and IDL, I would have thought that for such a basic function, the speed
would be approximatively the same.
I suppose that some of the difference may come from the default data
type of 64bits in numpy and 32 bits in IDL. Is there a way to change the
numpy default data type (without recompiling) ?
And I'm not an expert at all, maybe there is a better explanation, like
a better use of the several CPU core by IDL ?
I'm working with windows 7 64 bits on a core i7.
any hint is welcome.
Here the IDL code :
Julian1 = SYSTIME( /JULIAN , /UTC )
for j=0,9999 do begin
for i=0,999 do begin
Julian2 = SYSTIME( /JULIAN , /UTC )
% Compiled module: $MAIN$.
The python code:
from numpy import *
from time import time
time1 = time()
for j in range(10000):
for i in range(1000):
time2 = time()
In : run python_test_speed.py
More information about the NumPy-Discussion