Python: New patch may give speedups of up to 20%
svn.python.org
svn.python.org
Other question is whenever this patch is really so interesting to HN. It is pretty much insignificant for real applications and I'd consider the computed goto trick well known in circles where it might be useful for something (which means interpretive VMs and not much else).
The only case that actually matters is _your_ case and the only way you'll know is to benchmark it yourself.
For those interested, look at all the performance improvements made in the ocaml and perl and clisp interpreters. There is a lot of low hanging performance fruit left in the Python interpreter - the question is whether it's worth plucking. For instance, python can get a dedicated accumulator (I don't think it has one now) and you can introduce new opcodes that combine functionality of frequently occurring opcode sequences. For instance, python now has a LOAD_CONST and BINARY_ADD instruction, but not LOAD_COST&ADD instruction like clisp.
By combining the functionality of two instructions into one you're essentially saving an opcode dispatch. Saving a jump is going to make a bigger difference than making a jump faster. So that's where I think the python guys should focus on if they really want to improve performance.
* dedicated accumulator: stack caching.
* LOAD_CONST&BINARY_ADD: superinstructions. (though research literature suggests that dynamic superinstructions fare better w.r.t. performance than the static approach you suggest)
I would have guessed that this phase in a language's evolution would come much earlier in the adoption curve. ...like, five years ago for python. Interesting!
Here's to further optimizations!