I just did it: my first python source code hack.
I replaced the NEXTARG and PEEKARG macros in ceval.c using a cast to
short pointer, and lo and behold, a crude measurement indicates one
to two percent speed increase.
That isn't much, but it is virtually for free!
Here are the macro's I used:
What version of CPython did you try that with? The latest py3k branch?
I had a quick look at 3.2, 2.5 and 2.7 and got the impression that
the savings is more if the interpreter loop is faster: the fewer
instructions there are, the bigger a 3 instruction difference would
make.
The NEXTAR
I tried to find any research on this subject, but I couldn't find any,
so I'll be daring and vulnerable and just try it out to see what your
thoughts
are.
I single stepped a simple loop in Python to see where the efficiency
bottlenecks are.
I was impressed by the optimizations already in ther