[Numpy-discussion] "import numpy" performance
Mon Jul 2 16:38:39 CDT 2012
On Mon, Jul 2, 2012 at 2:26 PM, Andrew Dalke <email@example.com> wrote:
> so the relevant timing test is more likely:
> % time python -c 'import numpy.core.multiarray'
> 0.086u 0.031s 0:00.12 91.6% 0+0k 0+0io 0pf+0w
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 do not know how to run the timing test you did, as I get:
> % python -c "import multiarray"
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> ImportError: No module named multi array
You just have to cd to the directory where multiarray.so lives. I get
the same numbers as David:
longs[core]> time python -c ''
longs[core]> time python -c 'import multiarray'
More information about the NumPy-Discussion