-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Optimise keyword arguments in the JIT #150724
Copy link
Copy link
Open
Labels
3.16new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-JIT
Metadata
Metadata
Assignees
Labels
3.16new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-JIT
Fields
Give feedbackNo fields configured for issues without a type.
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
with keyword arguments:
requires the tuple
("b", "a")to pushed to the stack after the argumentsand for the
CALL_KW_PYinstruction 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_PYwith a much more effcientCALL_PY_EXACT_ARGSIn the example above:
can be replaced with