bpo-44900: Add five superinstructions. by markshannon · Pull Request #27741 · python/cpython
Conversation
Is it worth micro-optimizing to use STACK_SHRINK(2)/STACK_GROW(2)/TOP()/SECOND()/SET_TOP()/SET_SECOND() rather than PUSH/POP? The error cases would have to then do the appropriate stack adjustment, but STORE_FAST__LOAD_FAST wouldn't have to do any stack adjustment at all in the non-error case.
Comparing the commit using STACK_GROW etc to the original version shows that it actual slows things down by a small amount ( < 1%).
28 slower, 11 faster, 19 no change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters