This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author simonb1
Recipients
Date 2006-01-18.03:21:12
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
An experiment where the big switch in ceval.c
is replaced with a computed goto construct.
Uses #define's to make it optional.
Inspired by Mono's MINT interpreter code,
and Neil Norwitz's attempt to use a function
pointer table:

http://sourceforge.net/tracker/index.php?func=detail&aid=693638&group_id=5470&atid=305470

Result: about 1% slower on the pystone benchmark.

Also it seems to have broken the interpreter;
at least one test fails (test_StringIO).

Not sure if the other switch speedup
hacks (eg. PREDICT(op)) conflict 
at all with this patch (ie. make it
slower than it could be).

Mono actually uses a much larger opcode
set, with 2-byte opcodes, that includes
type info in each opcode. This means that
the actual case statements are much faster.
My initial thought about using computed goto's
(January 2003) was that the python opcode cases
were much fatter than mono's (often involving
a function call) and that the overhead of
branching on the opcode would be insignificant.
It seems that this is true indeed.

Patch is for python revision 42025.
History
Date User Action Args
2007-08-23 15:45:22adminlinkissue1408710 messages
2007-08-23 15:45:22admincreate