[Numpy-discussion] "import numpy" is slow
Fri Aug 1 14:49:54 CDT 2008
On Fri, Aug 1, 2008 at 11:53, Gael Varoquaux
> On Fri, Aug 01, 2008 at 09:18:48AM -0700, Christopher Barker wrote:
>> > What does python -c "import sys; print sys.path" say ?
>> A lot! 41 entries, and lot's of eggs -- are eggs an issue? I'm also
>> wondering how the order is determined -- if it looked in site-packages
>> first, it would find numpy a whole lot faster.
> AFAIK this is a setuptools issue. From what I hear, it might be fixed in
> the svn version of setuptools, but they still have to make a release that
> has this feature.
> The two issues I can see are: import path priority, it should be screwed
> up like it is, and speed. Speed is obviously a hard problem.
>> I suspect the thing to do is to re-install from scratch, and only add in
>> packages I'm really using now.
> Avoid eggs if you can. This has been my policy. I am not sure how much
> this is just superstition or a real problem, though.
[~]$ python -c "import sys; print len(sys.path)"
[~]$ python -v -v -c "import numpy" 2> foo.txt
[~]$ wc -l foo.txt
[~]$ time python -c "import numpy"
python -c "import numpy" 0.18s user 0.46s system 88% cpu 0.716 total
So cut it out.
Chris, please profile your import so we actually have some real
information to work with instead of prejudices.
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion