[Numpy-discussion] "import numpy" performance

Andrew Dalke dalke@dalkescientific....
Fri Jul 6 08:48:29 CDT 2012


I followed the instructions at
 http://docs.scipy.org/doc/numpy/dev/gitwash/patching.html
and added Ticket #2181 (with patch) at
 http://projects.scipy.org/numpy/ticket/2181

This remove the 5 'exec' calls from polynomial/*.py and improves
the 'import numpy' time by about 25-30%. That is, on my laptop

python -c 'import time; t1=time.time(); import numpy; print time.time()-t1'

goes from 0.079 seconds to 0.057 (best of 10 for both cases).


The patch does mean that if someone edits the template then they will
need to run the template expansion script manually. I think it's
well worth the effort.

Cheers,

				Andrew
				dalke@dalkescientific.com




More information about the NumPy-Discussion mailing list