Combined instructions #152
Replies: 5 comments
-
Well, I'm pretty much ready to give up on this. See these comments for why (a bit repetitive):
Basically ADD_INT is 0.1% of opcodes statically, and 0.5% dynamically; the POP_JUMP_IF[_NOT]_NONE opcodes are 0.2% statically (I expect the dynamic count to be 5x that but I didn't measure it) and I expect less return from RETURN_CONST/NONE. |
Beta Was this translation helpful? Give feedback.
-
Some research was done on this previously by Serhiy in https://bugs.python.org/issue27255. |
Beta Was this translation helpful? Give feedback.
-
Victor proposed RETURN_NONE before: https://bugs.python.org/issue28800 (and there's some discussion of RETURN_CONST there too). It was in the end rejected because (by definition) it can't occur in loops. |
Beta Was this translation helpful? Give feedback.
-
Any bytecodes can occur in a loop, if they are in a function that is called in a loop. What do the numbers say? |
Beta Was this translation helpful? Give feedback.
-
I’m going to have to spend some time developing a systematic approach to measuring this, both statically and dynamically. Eric already did some work on dynamic measurements. |
Beta Was this translation helpful? Give feedback.
-
This is a spin-off from #16 (Super-instructions). Where the idea promoted in #16 is to keep the opcode count the same and replace the first opcode of a common pair by a new instruction that peeks ahead to get the oparg of the second instruction (and moves the program counter accordingly), the idea if combined instructions is to simply replace a pair of opcodes (e.g. LOAD_FAST + RETURN_VALUE) by a single opcode (e.g. RETURN_CONST or even RETURN_NONE).
All the work I've done so far is of the latter type, so this issue is about that. Starting with python/cpython#25090.
Beta Was this translation helpful? Give feedback.
All reactions