[Python-Dev] Fast access to __builtins__

M.-A. Lemburg mal@lemburg.com
Fri, 28 Mar 2003 09:34:54 +0100


Raymond Hettinger wrote:
 > [per module switch]
> That makes good sense.  
> Are you guys thinking of something like this:
> 
> __fastbuiltins__ = True  # optimize all subsequent defs in the module
> 
> [M.-A. Lemburg]
> 
>>BTW, why not have a new opcode for symbols in the
>>builtins and then only tweak the opcode implementation
>>instead of having the compiler generate different code ?
> 
> Either way results in changing one opcode/oparg pair, so I
> don't see how having a new opcode helps.  At some point,
> the name has to be looked-up and a reference to it stored.
> Afterwards, LOAD_CONST is all that is needed to fetch
> the reference.

Right, but with the new opcode you could have the interpreter
decide whether to optimize or not without recompiling the
code.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Mar 28 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
Python UK 2003, Oxford:                                      4 days left
EuroPython 2003, Charleroi, Belgium:                        88 days left