Marc-Andre Lemburg added the comment:

The localization using keyword parameters is a very old trick to avoid global 
lookups. It does give a noticeable speedup, esp. when the localized variables 
are used in tight loops or the function itself is used in such loops.

The 5% speedup Steven measured matches my experience with this trick as well. 
In some cases, it can provide a more dramatic speedup, but this depends a lot 
on how the code is written.

----------
nosy: +lemburg

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29724>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to