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.

Author Dennis Sweeney
Recipients Dennis Sweeney, brandtbucher
Date 2022-03-17.22:44:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647557078.86.0.480735606049.issue47053@roundup.psfhosted.org>
In-reply-to
Content
There was a discussion here: https://github.com/faster-cpython/ideas/discussions/269

Checking for whether the assignment target is the left-hand side, rather than just checking for the right refcount, is more stable and reduces the number of deoptimizations, and even increases performance on some benchmarks.

Note that `PyUnicode_Append` is already a somewhat expensive function that already checks for the right reference counts, so it's fine to let as much code as possible get there, even if it will take the slow path -- we mostly just want to reduce allocations and avoid the quadratic string concatenation otherwise.
History
Date User Action Args
2022-03-17 22:44:38Dennis Sweeneysetrecipients: + Dennis Sweeney, brandtbucher
2022-03-17 22:44:38Dennis Sweeneysetmessageid: <1647557078.86.0.480735606049.issue47053@roundup.psfhosted.org>
2022-03-17 22:44:38Dennis Sweeneylinkissue47053 messages
2022-03-17 22:44:38Dennis Sweeneycreate