René's URL Explorer Experiment


Title: gh-158660: Add `PyListWriter` C API by vstinner · Pull Request #160127 · python/cpython · GitHub

Open Graph Title: gh-158660: Add `PyListWriter` C API by vstinner · Pull Request #160127 · python/cpython

X Title: gh-158660: Add `PyListWriter` C API by vstinner · Pull Request #160127 · python/cpython

Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

Open Graph Description: Issue: PyList_SetItem is ~2.7x slower per item on the free-threaded build #158660

X Description: Issue: PyList_SetItem is ~2.7x slower per item on the free-threaded build #158660

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

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/commits(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:7fd9ba99-eb5d-eb07-5615-d7c672d39bf0
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA3DC:22DB35:49CDD56:5DE1F9B:6B0241FF
html-safe-nonceaa6f429424c4e4e27a332731ea93da7f3ed4517825c2cacdf2483e7a1fb29304
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0RDOjIyREIzNTo0OUNERDU2OjVERTFGOUI6NkIwMjQxRkYiLCJ2aXNpdG9yX2lkIjoiNjI5MzUzMDc3MTY0Njk4ODc5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0179d3024e0a34208c26436b990a06ddcc997ea06688031366843968b28b6af7
hovercard-subject-tagpull_request:4959047225
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/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/160127/commits
twitter:imagehttps://opengraph.githubassets.com/eb7e60840cfc2450ddd191f50f24fe34daf7b83671b8c29436fa200287bb928b/python/cpython/pull/160127
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/eb7e60840cfc2450ddd191f50f24fe34daf7b83671b8c29436fa200287bb928b/python/cpython/pull/160127
og:image:altIssue: PyList_SetItem is ~2.7x slower per item on the free-threaded build #158660
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevstinner
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-cache
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
disable-turbofalse
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
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/cpython/pull/160127/commits#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F160127%2Fcommits
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%2F160127%2Fcommits
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%2Fcommits&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/160127/commits
Reloadhttps://github.com/python/cpython/pull/160127/commits
Reloadhttps://github.com/python/cpython/pull/160127/commits
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
https://github.com/python/cpython
vstinnerhttps://github.com/vstinner
python:mainhttps://github.com/python/cpython/tree/main
vstinner:list_writerhttps://github.com/vstinner/cpython/tree/list_writer
Conversationhttps://github.com/python/cpython/pull/160127
Commits21 (21)https://github.com/python/cpython/pull/160127/commits
Checkshttps://github.com/python/cpython/pull/160127/checks
Files changedhttps://github.com/python/cpython/pull/160127/files
gh-158660: Add PyListWriter C APIhttps://github.com/python/cpython/pull/160127/commits#top
vstinnerhttps://github.com/vstinner
python:mainhttps://github.com/python/cpython/tree/main
vstinner:list_writerhttps://github.com/vstinner/cpython/tree/list_writer
gh-158660: Add `PyListWriter` C APIhttps://github.com/python/cpython/pull/160127/commits/79a2ae5c8972cbe6b673d492ff2ed66c90d62a09
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
79a2ae5https://github.com/python/cpython/pull/160127/commits/79a2ae5c8972cbe6b673d492ff2ed66c90d62a09
https://github.com/python/cpython/tree/79a2ae5c8972cbe6b673d492ff2ed66c90d62a09
Inline PyList_SET_ITEM()https://github.com/python/cpython/pull/160127/commits/d8be30db3cfeb0640c05d8d377b32e178ef57c05
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
d8be30dhttps://github.com/python/cpython/pull/160127/commits/d8be30db3cfeb0640c05d8d377b32e178ef57c05
https://github.com/python/cpython/tree/d8be30db3cfeb0640c05d8d377b32e178ef57c05
Remove redundant test_list_writer()https://github.com/python/cpython/pull/160127/commits/398c4b38844d5a721484c52729f0f90cefb88339
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
398c4b3https://github.com/python/cpython/pull/160127/commits/398c4b38844d5a721484c52729f0f90cefb88339
https://github.com/python/cpython/tree/398c4b38844d5a721484c52729f0f90cefb88339
Move _PyObject_GC_TRACK() to PyListWriter_Finish()https://github.com/python/cpython/pull/160127/commits/3df6e01c30946b1f3755c871cb47a12f8917be8f
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
3df6e01https://github.com/python/cpython/pull/160127/commits/3df6e01c30946b1f3755c871cb47a12f8917be8f
https://github.com/python/cpython/tree/3df6e01c30946b1f3755c871cb47a12f8917be8f
Merge branch 'main' into list_writerhttps://github.com/python/cpython/pull/160127/commits/b0edd12fc5300211fe4ea3749d1754d532dea947
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
b0edd12https://github.com/python/cpython/pull/160127/commits/b0edd12fc5300211fe4ea3749d1754d532dea947
https://github.com/python/cpython/tree/b0edd12fc5300211fe4ea3749d1754d532dea947
Clarify PyListWriter_ExtendArray() dochttps://github.com/python/cpython/pull/160127/commits/f9d714500a96208212f37f85ca803ccda5b74a61
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
f9d7145https://github.com/python/cpython/pull/160127/commits/f9d714500a96208212f37f85ca803ccda5b74a61
https://github.com/python/cpython/tree/f9d714500a96208212f37f85ca803ccda5b74a61
Use list_new_prealloc() in PyListWriter_Create()https://github.com/python/cpython/pull/160127/commits/d096f46540645aed0c13b52f0e1aa8ec8c4ecdf1
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
d096f46https://github.com/python/cpython/pull/160127/commits/d096f46540645aed0c13b52f0e1aa8ec8c4ecdf1
https://github.com/python/cpython/tree/d096f46540645aed0c13b52f0e1aa8ec8c4ecdf1
Update PyListWriter_Create() commenthttps://github.com/python/cpython/pull/160127/commits/a8c24ee4203a0d9efb22bdaed823d5802f21b731
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
a8c24eehttps://github.com/python/cpython/pull/160127/commits/a8c24ee4203a0d9efb22bdaed823d5802f21b731
https://github.com/python/cpython/tree/a8c24ee4203a0d9efb22bdaed823d5802f21b731
Add PyListWriter_ExtendArraySteal() functionhttps://github.com/python/cpython/pull/160127/commits/31e5f1b8fb273fa9942cba538c03feadf93d36bb
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
31e5f1bhttps://github.com/python/cpython/pull/160127/commits/31e5f1b8fb273fa9942cba538c03feadf93d36bb
https://github.com/python/cpython/tree/31e5f1b8fb273fa9942cba538c03feadf93d36bb
Fix doc: use :term: not :ref:https://github.com/python/cpython/pull/160127/commits/db8eb510bb8cfc9405671e9d0c1e400c0c909ac5
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
db8eb51https://github.com/python/cpython/pull/160127/commits/db8eb510bb8cfc9405671e9d0c1e400c0c909ac5
https://github.com/python/cpython/tree/db8eb510bb8cfc9405671e9d0c1e400c0c909ac5
Avoid undefined behavior: memset() with size=0https://github.com/python/cpython/pull/160127/commits/da86200cc0952f9bdb19d6e4fd7ba2936e1c9568
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
da86200https://github.com/python/cpython/pull/160127/commits/da86200cc0952f9bdb19d6e4fd7ba2936e1c9568
https://github.com/python/cpython/tree/da86200cc0952f9bdb19d6e4fd7ba2936e1c9568
Finish() shrinks the listhttps://github.com/python/cpython/pull/160127/commits/748ac2477c7128547cb080c319abb2d1fb375d1f
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
748ac24https://github.com/python/cpython/pull/160127/commits/748ac2477c7128547cb080c319abb2d1fb375d1f
https://github.com/python/cpython/tree/748ac2477c7128547cb080c319abb2d1fb375d1f
On error, Extend() restores the writer to its previous statehttps://github.com/python/cpython/pull/160127/commits/9efaf876f162f4466b4c4b18d8453256134459c7
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
9efaf87https://github.com/python/cpython/pull/160127/commits/9efaf876f162f4466b4c4b18d8453256134459c7
https://github.com/python/cpython/tree/9efaf876f162f4466b4c4b18d8453256134459c7
Add PyListWriter_FromFormat()https://github.com/python/cpython/pull/160127/commits/8404760ed8617f8513c33217459b472df65b8d1e
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
8404760https://github.com/python/cpython/pull/160127/commits/8404760ed8617f8513c33217459b472df65b8d1e
https://github.com/python/cpython/tree/8404760ed8617f8513c33217459b472df65b8d1e
Fix undefined behavior in listwriter_extend_array() with nitem=0https://github.com/python/cpython/pull/160127/commits/9313299aa97517b6718e29319232b7db3e5722a1
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
9313299https://github.com/python/cpython/pull/160127/commits/9313299aa97517b6718e29319232b7db3e5722a1
https://github.com/python/cpython/tree/9313299aa97517b6718e29319232b7db3e5722a1
Inline listwriter_extend_array()https://github.com/python/cpython/pull/160127/commits/8c7ec583a7f19f97f0e7b8dd64c1697e214dbfeb
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
8c7ec58https://github.com/python/cpython/pull/160127/commits/8c7ec583a7f19f97f0e7b8dd64c1697e214dbfeb
https://github.com/python/cpython/tree/8c7ec583a7f19f97f0e7b8dd64c1697e214dbfeb
Add PyListWriter_FromBuffer() functionhttps://github.com/python/cpython/pull/160127/commits/e9dbc5e2f83e2fe1bc9eaa208633cb610815cc2e
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
e9dbc5ehttps://github.com/python/cpython/pull/160127/commits/e9dbc5e2f83e2fe1bc9eaa208633cb610815cc2e
https://github.com/python/cpython/tree/e9dbc5e2f83e2fe1bc9eaa208633cb610815cc2e
Fix dochttps://github.com/python/cpython/pull/160127/commits/995f2d5bce1babf145bb7f7828d6ef4d5b38514e
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
995f2d5https://github.com/python/cpython/pull/160127/commits/995f2d5bce1babf145bb7f7828d6ef4d5b38514e
https://github.com/python/cpython/tree/995f2d5bce1babf145bb7f7828d6ef4d5b38514e
Optimize PyListWriter_FromBuffer()https://github.com/python/cpython/pull/160127/commits/c808cb7bf756238ea3118e8c80ef0f9a0ab5e2de
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
c808cb7https://github.com/python/cpython/pull/160127/commits/c808cb7bf756238ea3118e8c80ef0f9a0ab5e2de
https://github.com/python/cpython/tree/c808cb7bf756238ea3118e8c80ef0f9a0ab5e2de
Resize the list once in PyListWriter_FromBuffer()https://github.com/python/cpython/pull/160127/commits/8e07fa1fa5038ffc0d995e1bd803858449d0e4a2
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
8e07fa1https://github.com/python/cpython/pull/160127/commits/8e07fa1fa5038ffc0d995e1bd803858449d0e4a2
https://github.com/python/cpython/tree/8e07fa1fa5038ffc0d995e1bd803858449d0e4a2
FromBuffer() tests compare to mview.tolist() and array.tolist()https://github.com/python/cpython/pull/160127/commits/04c4d30ba83c0367ee5d0b48c9aea730cd786f25
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
04c4d30https://github.com/python/cpython/pull/160127/commits/04c4d30ba83c0367ee5d0b48c9aea730cd786f25
https://github.com/python/cpython/tree/04c4d30ba83c0367ee5d0b48c9aea730cd786f25
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.