[Numpy-discussion] chebyshev, laguerre, ... exec() template code at each import

Charles R Harris charlesr.harris@gmail....
Tue Aug 6 21:37:10 CDT 2013

On Tue, Aug 6, 2013 at 8:32 PM, Andrew Dalke <dalke@dalkescientific.com>wrote:

> Hi all,
>   I mostly develop software related cheminformatics. There
> isn't much direct overlap between the tools of that field
> and NumPy and SciPy provide, but it's increasing with the
> use of scikit-learn and pandas.
>   I tend to write command-line tools which indirectly
> import numpy. I've noticed that 25% of the "import numpy"
> cost of about 0.081 seconds is due to the chebyshev, laguerre,
> legendre, hermite_e, and hermite_e modules. Each module
> takes about 0.004 seconds to import.
>   This is because each of them does a:
> exec(polytemplate.substitute(name='Chebyshev', nick='cheb',
> domain='[-1,1]'))
> during import. It appears that *everyone* takes a 0.02 second
> overhead during "import numpy" in order to simplify maintenance.
> This balance doesn't seem correct, given the number of people
> who use numpy vs. how rarely the polytemplate changes.
> Last year I submitted a patch which pre-computed all of those
> templates, so they would only be byte-compiled once.
> I knew (and still know) almost nothing about git/github, so
> Scott Sinclair kindly took it up and made it a pull request at:
>    https://github.com/numpy/numpy/pull/334
> I see that there's been no activity for at least 10 months.
> Is there anything more I can do to encourage that this patch
> be accepted?
Hi Andrew,

I haven't forgotten and intend to look at it before the next release.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130806/140f4e99/attachment.html 

More information about the NumPy-Discussion mailing list