[Numpy-discussion] "import numpy" performance
Mon Jul 2 17:46:41 CDT 2012
On Mon, Jul 2, 2012 at 11:15 PM, Andrew Dalke <firstname.lastname@example.org> wrote:
> On Jul 2, 2012, at 11:38 PM, Fernando Perez wrote:
>> No, that's the wrong thing to test, because it effectively amounts to
>> 'import numpy', sicne the numpy __init__ file is still executed. As
>> David indicated, you must import multarray.so by itself.
> I understand that clarification. However, it does not affect me.
It is indeed irrelevant to your end goal, but it does affect the
interpretation of what import_array does, and thus of your benchmark
polynomial is definitely the big new overhead (I don't remember it
being significant last time I optimized numpy import times), it is
roughly 30 % of the total cost of importing numpy (95 -> 70 ms total
time, of which numpy went from 70 to 50 ms). Then ctypeslib and test
are the two other significant ones.
I use profile_imports.py from bzr as follows:
Focusing on polynomial seems the only sensible action. Except for
test, all the other stuff seem difficult to change without breaking
More information about the NumPy-Discussion