[SciPy-dev] time to import scipy?

Ondrej Certik ondrej at certik.cz
Wed Mar 12 06:32:45 EDT 2008


On Wed, Mar 12, 2008 at 3:30 AM, David Cournapeau
<david at ar.media.kyoto-u.ac.jp> wrote:
> Joseph VanAndel wrote:
>  > When I import scipy (or just scipy.io) on a CentOS 5 64 bit computer, 4
>  > processor, 3.00 Ghz server, with Python 2.5.1, it takes ~10 seconds of
>  > elapsed time.
>  >
>  > When I'm developing and testing a Python script, I typically start the
>  > python interpreter dozens of times, so I concerned by how much time I
>  > spend waiting for the Python to startup.
>  >
>  > 1) Is there anything I can do to speed up the import of scipy?
>  >
>
>  Where is scipy (and its dependencies) installed ? Is it on NFS (or slow
>  filesystem, usb, etc...) ? If so, putting it locally could be a huge win.
>
>  10 second for scipy the first time (cold start) is not surprising: scipy
>  is a big package, and most time is spent on IO (reading files from the
>  fs). But the 2d time, a lot of this is in memory (IO buffer), so it will
>  be very fast. Numbers given by Ondrej suggest that it is a hot start in
>  his case (or that he has an extremely powerful workstation:) ).
>
>  In my case (and scipy is on NFS):
>
>  (cold start)
>  time python -c "import scipy"
>
>  real    0m4.007s
>  user    0m0.440s
>  sys     0m0.236s
>
>  (hot start)
>  time python -c "import scipy"
>
>  real    0m0.867s
>  user    0m0.388s
>  sys     0m0.212s

Yes, my numbers are for "hot start", because that is what is used when
developing with scipy.

Ondrej



More information about the SciPy-Dev mailing list