[Python-Dev] Byte code arguments from two to one byte: did anyone try this?

2011-01-31 Thread Jurjen N.E. Bos
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

[Python-Dev] Followup: Byte code arguments from two to one byte: did anyone try this?

2011-01-31 Thread Jurjen N.E. Bos
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

[Python-Dev] short fetch for NEXTARG macro (was: one byte byte code arguments)

2011-01-31 Thread Jurjen N.E. Bos
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