[Python-Dev] Bytecode idea

Neal Norwitz neal@metaslash.com
Wed, 26 Feb 2003 09:32:06 -0500


On Wed, Feb 26, 2003 at 04:48:37AM +0100, Christian Tismer wrote:
> 
> Maybe it also makes sense to use indexing into a static
> array, instead of the case construct. Note that there
> can be one single such table for all opcodes and all cases,
> since opcodes are still disjoint. It depends where this
> table is stored and if this can get in the cache.
> 
> While I don't know if this really makes the interpreter
> more efficient, at least it makes it shorter to read
> and maybe easier to maintain.

Been there, done that:  http://python.org/sf/693638

I already rejected the patch. :-) Making my own jump table, rather
than using a switch was about 15% slower.  Read the patch for more
info.  While I'm sure the patch could be improved, I don't think it
would have made enough of a difference to make a change.

Neal