This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Improve efficiency of PRECALL/CALL instructions
Type: Stage: patch review
Components: Versions:
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon
Priority: normal Keywords: patch

Created on 2022-01-26 09:44 by Mark.Shannon, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 31231 merged Mark.Shannon, 2022-02-09 16:21
Messages (3)
msg411721 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-01-26 09:44
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.
msg411723 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-01-26 09:54
Possibly consider replacing the specializations for `str(arg)` and `tuple(arg)` with a more general bytecode that can be used for other objects as well.
msg412996 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-02-10 12:57
New changeset 2cea8c29cf975a8ad7d8c3ff19d1e836c2d54707 by Mark Shannon in branch 'main':
bpo-46532: Reduce number of memory writes to update call_shape.kwnames. (GH-31231)
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90690
2022-02-10 12:57:59Mark.Shannonsetmessages: + msg412996
2022-02-09 16:21:25Mark.Shannonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request29401
2022-02-09 16:20:06Mark.Shannonsettitle: Improve effeciency of PRECALL/CALL instructions -> Improve efficiency of PRECALL/CALL instructions
2022-01-26 09:54:04Mark.Shannonsetmessages: + msg411723
2022-01-26 09:44:42Mark.Shannoncreate