René's URL Explorer Experiment


Title: gh-150942: Speed up FrameLocalsProxy.values() by catlover-bot · Pull Request #156055 · python/cpython · GitHub

Open Graph Title: gh-150942: Speed up FrameLocalsProxy.values() by catlover-bot · Pull Request #156055 · python/cpython

X Title: gh-150942: Speed up FrameLocalsProxy.values() by catlover-bot · Pull Request #156055 · python/cpython

Description: Summary Use _PyList_AppendTakeRef() when adding owned values returned by framelocalsproxy_getval() to FrameLocalsProxy.values(). framelocalsproxy_getval() returns a new reference. Transferring it directly to the result list avoids the extra incref/decref pair from PyList_Append(). This update merges current main (9d22a5334bd5273962adceeb697a1337e9a0ca21) into the existing PR branch and preserves its duplicate-local-name filtering: First occurrences transfer their owned reference to the list. Duplicate values and deduplication-error paths release the unused reference. Extra-locals values remain borrowed and continue to use PyList_Append(). Add a mortal-object regression covering ordinary locals, duplicate local names, extra locals, and reference release after clearing the frame/list. A NEWS entry is included. Performance The earlier pyperf results used a baseline from before the upstream local-name deduplication change. They do not establish the performance of this updated implementation, so the old numerical speedup claims have been removed. No numerical performance claim is made for the current head. Controlled same-lineage pyperf measurements are still needed. Validation Rebuilt and tested the updated source on Linux x86-64 with GCC 14.2.0: Debug, release, and free-threaded debug builds: python -m test test_frame test_listcomps passed (156 tests per build, 9 skips). Debug and free-threaded debug builds: python -m test -R 3:3 test_frame test_listcomps passed with no positive reference leaks. Allocation-failure sweeps with distinct mortal objects passed on all three builds; every attempt reclaimed all values. test_scope, test_inspect, test_trace, test_generators, and test_genexps passed (517 tests, 1 skip). Change-only git diff --check, CPython patchcheck, Python compilation, and indentation checks passed. The nine focused-test skips include eight existing mapping-protocol skips and one _ctypes-dependent C API test because that optional build dependency was unavailable. The full test suite, complete pre-commit lint, sanitizers, and PGO/LTO benchmarks were not run locally; remote CI remains separate. AI assistance was used to prepare the merge conflict resolution, regression test, and local verification. Issue: gh-150942

Open Graph Description: Summary Use _PyList_AppendTakeRef() when adding owned values returned by framelocalsproxy_getval() to FrameLocalsProxy.values(). framelocalsproxy_getval() returns a new reference. Transferring it d...

X Description: Summary Use _PyList_AppendTakeRef() when adding owned values returned by framelocalsproxy_getval() to FrameLocalsProxy.values(). framelocalsproxy_getval() returns a new reference. Transferring it d...

Opengraph URL: https://github.com/python/cpython/pull/156055

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:3406881a-f77c-e584-e26d-1b6f84efac85
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCC50:B1B84:3252096:4005DD6:6B020CDE
html-safe-noncebf1127024807a7b803121b502af2a853164074981ee6717990a3efb88850ebf4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzUwOkIxQjg0OjMyNTIwOTY6NDAwNURENjo2QjAyMENERSIsInZpc2l0b3JfaWQiOiI3MTE3MzI2OTk5NjI2MDU4OTc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2d58931d39a08edbae8f2be5ea1f20884048768ceb2ff4766906b734bee2cc98
hovercard-subject-tagpull_request:4314703208
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/156055/files
twitter:imagehttps://avatars.githubusercontent.com/u/203637895?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/203637895?s=400&v=4
og:image:altSummary Use _PyList_AppendTakeRef() when adding owned values returned by framelocalsproxy_getval() to FrameLocalsProxy.values(). framelocalsproxy_getval() returns a new reference. Transferring it d...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/156055/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F156055%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F156055%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/156055/files
Reloadhttps://github.com/python/cpython/pull/156055/files
Reloadhttps://github.com/python/cpython/pull/156055/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
catlover-bothttps://github.com/catlover-bot
python:mainhttps://github.com/python/cpython/tree/main
catlover-bot:perf-framelocalsproxy-values-takerefhttps://github.com/catlover-bot/cpython/tree/perf-framelocalsproxy-values-takeref
Conversation 2 https://github.com/python/cpython/pull/156055
Commits 2 https://github.com/python/cpython/pull/156055/commits
Checks 52 https://github.com/python/cpython/pull/156055/checks
Files changed 3 https://github.com/python/cpython/pull/156055/files
gh-150942: Speed up FrameLocalsProxy.values() https://github.com/python/cpython/pull/156055/files#top
Show all changes 2 commits https://github.com/python/cpython/pull/156055/files
dc42221 gh-150942: Speed up FrameLocalsProxy.values() catlover-bot Aug 19, 2026 https://github.com/python/cpython/pull/156055/commits/dc422210744d943ea42e8f63a64530d483b0cad3
028990a Merge upstream main and preserve FrameLocalsProxy.values() ownership catlover-bot Oct 4, 2026 https://github.com/python/cpython/pull/156055/commits/028990af67dd83df15ca9b138c66ce745f953486
Clear filters https://github.com/python/cpython/pull/156055/files
Please reload this pagehttps://github.com/python/cpython/pull/156055/files
Please reload this pagehttps://github.com/python/cpython/pull/156055/files
test_frame.py https://github.com/python/cpython/pull/156055/files#diff-55c13388062eea8a35790a234232d00080f6c6e02fc0f1e945844f97c6c85012
2026-10-03-10-40-00.gh-issue-150942.mK9qLs.rst https://github.com/python/cpython/pull/156055/files#diff-f0b41e90f75118f8e609cf7f7250489a9caba3b7095dd977fcfb04826a8339c0
frameobject.c https://github.com/python/cpython/pull/156055/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
Lib/test/test_frame.pyhttps://github.com/python/cpython/pull/156055/files#diff-55c13388062eea8a35790a234232d00080f6c6e02fc0f1e945844f97c6c85012
View file https://github.com/python/cpython/blob/028990af67dd83df15ca9b138c66ce745f953486/Lib/test/test_frame.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/156055/{{ revealButtonHref }}
https://github.com/python/cpython/pull/156055/files#diff-55c13388062eea8a35790a234232d00080f6c6e02fc0f1e945844f97c6c85012
https://github.com/python/cpython/pull/156055/files#diff-55c13388062eea8a35790a234232d00080f6c6e02fc0f1e945844f97c6c85012
Misc/NEWS.d/next/Core_and_Builtins/2026-10-03-10-40-00.gh-issue-150942.mK9qLs.rsthttps://github.com/python/cpython/pull/156055/files#diff-f0b41e90f75118f8e609cf7f7250489a9caba3b7095dd977fcfb04826a8339c0
View file https://github.com/python/cpython/blob/028990af67dd83df15ca9b138c66ce745f953486/Misc/NEWS.d/next/Core_and_Builtins/2026-10-03-10-40-00.gh-issue-150942.mK9qLs.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/156055/{{ revealButtonHref }}
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L213
Objects/frameobject.chttps://github.com/python/cpython/pull/156055/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
View file https://github.com/python/cpython/blob/028990af67dd83df15ca9b138c66ce745f953486/Objects/frameobject.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/156055/{{ revealButtonHref }}
https://github.com/python/cpython/pull/156055/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
https://github.com/python/cpython/pull/156055/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
Please reload this pagehttps://github.com/python/cpython/pull/156055/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.