[SciPy-user] NumPy vs. SciPy and other speed comparisons

Pearu Peterson pearu@cens.ioc...
Wed Jun 11 04:52:15 CDT 2008


Robert Kern wrote:

> What really annoys me is that "from scipy import *" imports all of the
> subpackages. Again. I don't know how many times I thought I removed
> that nonsense, but like a bloody vampire, it just ... keeps ... coming
> ... back.

There should be a unittest for that..

Eventhough scipy.__version__ == 0.7.0.dev4124 (that I have at the 
current computer) does not import scipy subpackages, it does import
lots of other stuff that seems unnecessary. For example, importing
nose takes 1/3 of the scipy import time:

pearu@pearu-laptop:~$ python
 >>> %time import scipy
CPU times: user 0.22 s, sys: 0.08 s, total: 0.30 s
Wall time: 0.29
 >>>
pearu@pearu-laptop:~$ python
 >>> %time import nose
CPU times: user 0.07 s, sys: 0.02 s, total: 0.10 s
Wall time: 0.10
 >>> %time import scipy
CPU times: user 0.13 s, sys: 0.04 s, total: 0.17 s
Wall time: 0.18

Another 1/3 of the time goes to importing numpy:
pearu@pearu-laptop:~$ python
 >>> %time import nose
CPU times: user 0.08 s, sys: 0.02 s, total: 0.10 s
Wall time: 0.10
 >>> %time import numpy
CPU times: user 0.07 s, sys: 0.02 s, total: 0.09 s
Wall time: 0.10
 >>> %time import scipy
CPU times: user 0.08 s, sys: 0.04 s, total: 0.11 s
Wall time: 0.11

Pearu


More information about the SciPy-user mailing list