[issue9225] Replace DUP_TOPX with DUP_TOP_TWO

Antoine Pitrou report at bugs.python.org
Mon Jul 12 13:33:17 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

> Oddly, at least with pybench, use of PREDICT(BINARY_SUBSCR) in
> DUP_TOP_TWO seems to show an always right PREDICT as slower than
> FAST_DISPATCH

The main point of computed gotos is to allow the CPU's branch predictor to predict opcode pairs by itself. So, yes, adding a manual PREDICT() might actually slow down the code (probably depending on the CPU model).

By the way, when you modify the bytecode, you have to change the magic number in Python/import.c.

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9225>
_______________________________________


More information about the Python-bugs-list mailing list