[issue27255] More opcode predictions

Raymond Hettinger report at bugs.python.org
Tue Jun 7 20:01:18 EDT 2016


Raymond Hettinger added the comment:

Serhiy, please slow down and stop rewriting every single thing you see.  Your rate of patches is prolific and hard to digest.  Please give some consideration that the people who came before you (lots of them) put a lot of thought into what was done and were deliberately conservative.

Dynamic statistics can vary widely depending on code being profiled (much like PGO optimizations for C compilers).   

For a prediction to have value, it needs to be a commonly used opcode; it must occur in a highly predictive pair with an intrinsic relationship rather than a coincidental relationship.

FWIW, these tests aren't free.  Global prediction tables have a limited size and are subject to aliasing.  Mispredictions are expensive.  Also, the ceval loop doesn't need more clutter.

The new opcodes GET_YIELD_FROM_ITER, GET_AITER, GET_ANEXT, and GET_AWAITABLE haven't been considered before.  The code in Python/compile.c shows that LOAD_CONST is the only possible next opcode, so these are reasonable candidates (i.e. the pair effectively acts as a single opcode).  Of these, I think only GET_ANEXT and GET_AWAITABLE are likely to occur in a loop.  So, these two may be worthwhile.  All the rest should probably be skipped.

----------
nosy: +rhettinger

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


More information about the Python-bugs-list mailing list