[SciPy-user] NumPy vs. SciPy and other speed comparisons
Ivo Maljevic
ivo.maljevic@gmail....
Wed Jun 11 08:44:29 CDT 2008
Actually, it was David who responded, so thanks David. My apology for Robert
still holds though.
Ivo
2008/6/11 Ivo Maljevic <ivo.maljevic@gmail.com>:
> Wow, I was typing a message and when I hit "Send" I found all these
> replies. Robert, my apologies for my "counterattack" and thank you for the
> explanations.
>
> Thanks,
> Ivo
>
> 2008/6/11 David Cournapeau <david@ar.media.kyoto-u.ac.jp>:
>
>> Ivo Maljevic wrote:
>>
>> > 2008/6/11 Robert Kern <robert.kern@gmail.com
>> > <mailto:robert.kern@gmail.com>>:
>> >
>> > Specifically, it is "from scipy import *" that imports the
>> > subpackages. "import scipy" does not.
>> >
>> > Sorry, but I am not sure I understand everything here.
>> >
>> > 1. "import scipy as sp" vs "import numpy as np", and then I added
>> > prefixes in front of all the functions. The times are the same, 44 and
>> > 23 seconds, respectively. There goes that theory.
>> >
>> > 2. I tried explicitly importing only the required functions, e.g,
>> > from numpy import sqrt, arange, ones, zeros, random, where, ceil, sign
>> > Agian, the same results.
>> >
>> > Would the loading time of the two packages account for over 20 seconds
>> > difference in execution time?
>>
>> Ok, the bad guy is..... sqrt. scipy.sqrt is much slower than numpy.sqrt
>> (note that in your script, you could avoid computing the scale of the
>> normal in the loop).
>>
>> cheers,
>>
>> David
>> _______________________________________________
>> SciPy-user mailing list
>> SciPy-user@scipy.org
>> http://projects.scipy.org/mailman/listinfo/scipy-user
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20080611/ee3135ec/attachment.html
More information about the SciPy-user
mailing list