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
{{ message }}
Repository navigation
Improve efficiency of PRECALL/CALL instructions #90690
The PRECALL/CALL bytecode pair for calls is new (still in review at time of writing) and is not as efficient as it could be.
Some possible improvements are:
Transfer refcount of func when making a frame.
NULL call_shape.kwnames after use instead of in PRECALL, as many specialized instructions already assert that it is NULL.
Specialize the PRECALL instructions. Either for simple cases like type(arg) so we can skip the CALL, or for complex cases like PythonClass(args) where PRECALL can create object, and set up the frame so that CALL calls the init function.
Activity
markshannon commentedon Jan 26, 2022
The PRECALL/CALL bytecode pair for calls is new (still in review at time of writing) and is not as efficient as it could be.
Some possible improvements are:
Transfer refcount of func when making a frame.
NULL call_shape.kwnames after use instead of in PRECALL, as many specialized instructions already assert that it is NULL.
Specialize the PRECALL instructions. Either for simple cases like
type(arg)so we can skip the CALL, or for complex cases likePythonClass(args)where PRECALL can create object, and set up the frame so thatCALLcalls the init function.markshannon commentedon Jan 26, 2022
Possibly consider replacing the specializations for
str(arg)andtuple(arg)with a more general bytecode that can be used for other objects as well.[-]Improve effeciency of PRECALL/CALL instructions[/-][+]Improve efficiency of PRECALL/CALL instructions[/+][-]Improve effeciency of PRECALL/CALL instructions[/-][+]Improve efficiency of PRECALL/CALL instructions[/+]markshannon commentedon Feb 10, 2022
New changeset 2cea8c2 by Mark Shannon in branch 'main':
bpo-46532: Reduce number of memory writes to update call_shape.kwnames. (GH-31231)
2cea8c2
markshannon commentedon May 18, 2022
As described here we can remove the
PRECALLinstruction entirely, shortening the call sequence for many calls.GH-90690: Remove `PRECALL` instruction (GH-92925)
GH-90690: Mention removal of ``PRECALL`` in What's New (#103910)
pythonGH-90690: Mention removal of ``PRECALL`` in What's New (pythonG…
[3.12] GH-90690: Mention removal of ``PRECALL`` in What's New (GH-103910
[REF] base: remove legacy opcodes