Message49340
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.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:45:22 | admin | link | issue1408710 messages |
2007-08-23 15:45:22 | admin | create | |
|