[Python-Dev] Re: opcode performance measurements
Jeremy Hylton
jeremy@alum.mit.edu
Thu, 31 Jan 2002 05:14:28 -0500
>>>>> "SM" == Skip Montanaro <skip@pobox.com> writes:
SM> Interesting results. I've been working on my
SM> {TRACK,UNTRACK}_GLOBAL opcode implementations. I have an
SM> optimizer filter that sets up tracking for all
SM> LOAD_GLOBAL,{LOAD_ATTR}* combinations. It's still not quite
SM> working and will only be a proof of concept by devday if I do
SM> get it working, but I expect most of these expensive opcode
SM> combinations to collapse into a LOAD_FAST, with the addition of
SM> a TRACK_GLOBAL/UNTRACK_GLOBAL pair executed at function start
SM> and end, respectively.
I won't have any implementation done at all, but should have finished
the design for LOAD_FAST-style access to globals and module
attributes. I also have some ideas about Python bytecode specializer
that would work essentially like a JIT but generated specialized
bytecode instead of machine code.
Jeremy
PS Skip-- Sorry the PEP isn't clear, but the only dictionary lookups
that need to occur are at function creation time. MAKE_FUNCTION would
need to lookup the offsets of the globals used by the functions, so
that a LOAD_FAST_GLOBAL opcode would take an int argument.