[Numpy-discussion] patches to reduce import costs
Kevin Jacobs <firstname.lastname@example.org>
Thu Jul 31 16:14:18 CDT 2008
For the help of freeze packages, it would be great if you could add a file
that lists all of the deferred imports that you run across. That way, we
can add/update recipes more easily for py2app, py2exe, bbfreeze, etc.
On Thu, Jul 31, 2008 at 4:44 PM, Andrew Dalke <email@example.com>wrote:
> I don't see a place to submit patches. Is there a patch manager for
> Here's a patch to defer importing 'tempfile' until needed. I
> previously mentioned one other place that didn't need tempfile. With
> this there is no 'import tempfile' during 'import numpy'
> This improves startup by about 7%
> --- numpy/lib/_datasource.py (revision 5576)
> +++ numpy/lib/_datasource.py (working copy)
> @@ -35,7 +35,6 @@
> __docformat__ = "restructuredtext en"
> import os
> -import tempfile
> from shutil import rmtree
> from urlparse import urlparse
> @@ -131,6 +130,7 @@
> self._destpath = os.path.abspath(destpath)
> self._istmpdest = False
> + import tempfile
> self._destpath = tempfile.mkdtemp()
> self._istmpdest = True
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion