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: Specialize UNPACK_SEQUENCE
Type: performance Stage: resolved
Components: Interpreter Core Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brandtbucher Nosy List: Mark.Shannon, brandtbucher
Priority: normal Keywords: patch

Created on 2022-02-10 00:35 by brandtbucher, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31240 merged brandtbucher, 2022-02-10 00:41
Messages (4)
msg412960 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2022-02-10 00:35
UNPACK_SEQUENCE already has fast paths for tuples and lists, which make up (literally) 99% of unpackings in the benchmark suite. What's more, two-element tuples make up about two-thirds of all unpackings (though I actually suspect it's even higher, since the unpack_sequence benchmark is definitely skewing the results towards 10-element lists and tuples).

These specializations are trivial to implement and result in a solid 1% improvement overall.
msg412962 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2022-02-10 01:00
(I also plan on looking into an adaptive super-duper-instruction for UNPACK_SEQUENCE_TWO_TUPLE__STORE_FAST__STORE_FAST after the current PR has landed).
msg413340 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2022-02-16 16:48
New changeset a9da085015db8cbb81f660158864ac94fe6c67a2 by Brandt Bucher in branch 'main':
bpo-46702: Specialize UNPACK_SEQUENCE (GH-31240)
https://github.com/python/cpython/commit/a9da085015db8cbb81f660158864ac94fe6c67a2
msg413512 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2022-02-18 21:19
Closing as UNPACK_SEQUENCE_TWO_TUPLE__STORE_FAST__STORE_FAST results in lots of hits, but no performance improvement.
History
Date User Action Args
2022-04-11 14:59:56adminsetgithub: 90858
2022-02-18 21:19:36brandtbuchersetstatus: open -> closed
resolution: fixed
messages: + msg413512

stage: patch review -> resolved
2022-02-16 16:48:20brandtbuchersetmessages: + msg413340
2022-02-10 01:00:03brandtbuchersetmessages: + msg412962
2022-02-10 00:41:16brandtbuchersetkeywords: + patch
pull_requests: + pull_request29410
2022-02-10 00:35:53brandtbuchercreate