◐ Shell
clean mode source ↗

bpo-44900: Add five superinstructions. by markshannon · Pull Request #27741 · python/cpython

Conversation

@sweeneyde

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.

@markshannon

It might well be. I'll try it out.

@markshannon

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.