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.

classification
Title: Implement _PyStack_UnpackDict() with a single allocation
Type: performance Stage: resolved
Components: Interpreter Core Versions: Python 3.8
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Mark.Shannon, jdemeyer, methane, petr.viktorin, scoder, vstinner
Priority: normal Keywords: patch

Created on 2019-05-13 15:22 by jdemeyer, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 13308 closed jdemeyer, 2019-05-14 09:45
PR 14517 merged jdemeyer, 2019-07-01 15:45
Messages (3)
msg342339 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2019-05-13 15:22
_PyStack_UnpackDict() is used to convert from the FastCallDict calling convention to FastCallKeywords. It currently needs two allocations: one for the tuple of keyword names and one for the array of arguments (positional and keyword).

This can be optimized by using a single allocation, storing everything in a single tuple. That tuple can then be artificially truncated to the required size when done.
msg342379 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2019-05-13 19:51
Ideally, this would be fixed together with #36907.
msg347124 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2019-07-02 09:49
New changeset d4efd917ac24940063a1ce80073fe3570c5f07f8 by Inada Naoki (Jeroen Demeyer) in branch 'master':
bpo-36904: Optimize _PyStack_UnpackDict (GH-14517)
https://github.com/python/cpython/commit/d4efd917ac24940063a1ce80073fe3570c5f07f8
History
Date User Action Args
2022-04-11 14:59:15adminsetgithub: 81085
2019-07-02 13:04:55jdemeyersetstatus: open -> closed
resolution: wont fix
stage: patch review -> resolved
2019-07-02 09:49:57methanesetnosy: + methane
messages: + msg347124
2019-07-01 15:45:46jdemeyersetpull_requests: + pull_request14333
2019-05-14 09:45:29jdemeyersetkeywords: + patch
stage: patch review
pull_requests: + pull_request13218
2019-05-13 19:54:28jdemeyersetcomponents: + Interpreter Core, - Library (Lib)
2019-05-13 19:51:37jdemeyersetmessages: + msg342379
2019-05-13 15:23:15jdemeyersetnosy: + vstinner
2019-05-13 15:22:54jdemeyercreate