Skip to content

[3.14] gh-146041: Avoid lock in sys.intern() for already interned strings (gh-146072)#146390

Open
colesbury wants to merge 1 commit intopython:3.14from
colesbury:backport-6009309-3.14
Open

[3.14] gh-146041: Avoid lock in sys.intern() for already interned strings (gh-146072)#146390
colesbury wants to merge 1 commit intopython:3.14from
colesbury:backport-6009309-3.14

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Mar 24, 2026

Fix free-threading scaling bottleneck in sys.intern and PyObject_SetAttr by avoiding the interpreter-wide lock when the string is already interned and immortalized.

(cherry picked from commit 6009309)

…ed strings (pythongh-146072)

Fix free-threading scaling bottleneck in sys.intern and `PyObject_SetAttr` by
avoiding the interpreter-wide lock when the string is already interned and
immortalized.
(cherry picked from commit 6009309)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit 7fa9a56 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F146390%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants