R
Raymond Hettinger
FWIW, I've posted a brief, but powerful recipe for a bytecode
optimization that saves known globals as constants:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940
It's not psyco, but it does run everywhere and is easy to use.
A key benefit is being able to localize variable access without adding
clutter to your code like: _random=random; _len=len.
One caveat is to run it in the builtin_only mode whenever some of the
module globals are going to be updated at runtime.
Raymond Hettinger
optimization that saves known globals as constants:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940
It's not psyco, but it does run everywhere and is easy to use.
A key benefit is being able to localize variable access without adding
clutter to your code like: _random=random; _len=len.
One caveat is to run it in the builtin_only mode whenever some of the
module globals are going to be updated at runtime.
Raymond Hettinger