
Guido van Rossum wrote:
In fact, why not do that for one-argument opcodes as well? If what you say is true, that should make argument decoding even faster than it is now!
Yes -- but also would cause about 30-40 copies of the same code (which could be a single macro call). This could easily be tested and timed though.
Yes, and we won't be able to conclude anything. This is micro-optimization which doesn't give meaningful results. Actually, when I played last time with the main loop (it was for 1.5.2 I believe) duplicating the second argfetch doesn't give any speedup. Mainly because the code for the 2nd byte fetch is already in the processor's cache. Consequently, testing and fetching the 2nd argbyte (or skipping it) is faster when it's done before the big switch. If it's done per opcode, the cache may be invalidated. Micro-optimization doesn't worth the effort. As to the 2-byte arg limit, I think I'd be happy if the compiler raises an exception if this limit is exceeded. unrelated-with-PEP-203'ly y's -- Vladimir MARANGOZOV | Vladimir.Marangozov@inrialpes.fr http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252