You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the JIT traces can see both sides of the call, it can remove the work done to parse and shuffle the arguments during optimization.
For example, calling the function
deffoo(a, b): pass
with keyword arguments:
foo(0, b=2, a=1)
requires the tuple ("b", "a") to pushed to the stack after the arguments
and for the CALL_KW_PY instruction to parse and reorder the arguments.
We can work out the reordering required and emit the necessary stack permuting code,
then replace the CALL_KW_PY with a much more effcient CALL_PY_EXACT_ARGS
@markshannon Where would you put the optimization to switch bytecode instructions for the jit? After completing a trace, the jit will only see the uops, which would make it harder to do the proposed change for CALL_KW_PY.
Activity
brijkapadia commentedon Jun 5, 2026
@markshannon Where would you put the optimization to switch bytecode instructions for the jit? After completing a trace, the jit will only see the uops, which would make it harder to do the proposed change for
CALL_KW_PY.pythongh-150724: Optimize JIT keyword calls to exact args