Assorted Questions regarding the future of Python...

Skip Montanaro skip at
Tue Nov 2 14:19:02 EST 1999

>>>>> "Francois" == ISO-8859-1  <ISO-8859-1> writes:

    François> I'm curious.  Does Python use standard optimisation techniques
    François> on that byte code (CSE, strength reduction, and all that)?  I
    François> would be tempted to guess that the stack machine receives code
    François> that pretty closely resemble the source code.  Would the stack
    François> machine be able to express optimisations?  For example, could
    François> we copy or exchange arbitrary stack elements?

Several people have worked on various optimizations to the Python virtual
machine or to the generated byte code over time.  Some of it has already
been adopted into compile.c or ceval.c.  As a result, I believe the latest
version of Python is probably at least twice as fast as 1.3 ('twould be
kinda neat if someone did the work to benchmark pystone against various
versions of the interpreter).  For pointers to stuff I've done (including a
peephole optimizer for Python bytecode), check out

For other reported work, check out the Python Conferece proceedings that are
online.  Pointers are available at

For a completely different look at the Python virtual machine, check out
the Rattlesnake list:

Rattlesnake hasn't gone anywhere in about a year, due to lack of time on my
part.  The idea is to implement a new three address virtual machine using
the existing runtime stack as the "registers", then convert the existing
stack-based bytecode to three address bytecode.  Three address form is
easier to optimize and should (in theory) execute faster after you apply
optimizations.  If people are interested in fiddling with it I'd be happy to
generate a context diff against the current CVS repository and put it up on
my Python Bits page.

Skip Montanaro |
skip at |
847-971-7098   | Python: Programming the way Guido indented...

More information about the Python-list mailing list