[SciPy-user] NumPy vs. SciPy and other speed comparisons
Wed Jun 11 03:39:27 CDT 2008
On Wed, Jun 11, 2008 at 09:15:44AM +0200, Matthieu Brucher wrote:
> The difference in speed may be only due to the fact that the scipy modle
> has much more functions than numpy's.
Matthieux does pipoint an interesting point: import time of scipy will be
much larger than import time of numpy. You could try to run the tests in
order to get rid of import time, eg by importing once, and running the
code many times.
However, if I recall correctly, there are other differences in fonctions
between scipy and numpy. Some functions in scipy do more than the
corresponding fonctions in numpy. Here is an example:
In : from scipy import sqrt as ssqrt
In : from numpy import sqrt as nsqrt
In : ssqrt(-1)
In : nsqrt(-1)
In : %timeit ssqrt(-1)
10000 loops, best of 3: 37.7 µs per loop
In : %timeit nsqrt(-1)
100000 loops, best of 3: 6.14 µs per loop
Maybe this is what you are seeing.
More information about the SciPy-user