René's URL Explorer Experiment


Title: GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. by markshannon · Pull Request #96801 · python/cpython · GitHub

Open Graph Title: GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. by markshannon · Pull Request #96801 · python/cpython

X Title: GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. by markshannon · Pull Request #96801 · python/cpython

Description: Requires an additional POP_TOP at the end of the loop. By itself, this would be a pointless change, but as part of #96793 it makes sense. Pyperformance shows a 1% slowdown but I suspect that is a bit noisy. The 11% slowdown of unpack_sequence makes no sense. Given the dispatching overhead is in the 10-15% and FOR_ITER represents 1-2% of instructions executed we would expect at worst a 0.3% slowdown. I will get performance numbers for the whole of #96793 before merging the parts. Issue: gh-96793

Open Graph Description: Requires an additional POP_TOP at the end of the loop. By itself, this would be a pointless change, but as part of #96793 it makes sense. Pyperformance shows a 1% slowdown but I suspect that is a b...

X Description: Requires an additional POP_TOP at the end of the loop. By itself, this would be a pointless change, but as part of #96793 it makes sense. Pyperformance shows a 1% slowdown but I suspect that is a b...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f8c6ddd9-26ed-fcd8-e052-99de9c011941
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9F50:2DE4E0:11A75DA:1739E4D:696B734E
html-safe-noncea646c1aeafd302ac399d3d0d238cdb3cb36d8541a2a7d4a7a68c1af15a7e01f9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjUwOjJERTRFMDoxMUE3NURBOjE3MzlFNEQ6Njk2QjczNEUiLCJ2aXNpdG9yX2lkIjoiMTQwNjczNTMzMDMzMTgxNjc4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac133d8f08e8147a09bbe4cfa9ba3e987b830ec7185b1c4c9b173ad70c40d6f251
hovercard-subject-tagpull_request:1054886052
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/96801/files
twitter:imagehttps://avatars.githubusercontent.com/u/9448417?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9448417?s=400&v=4
og:image:altRequires an additional POP_TOP at the end of the loop. By itself, this would be a pointless change, but as part of #96793 it makes sense. Pyperformance shows a 1% slowdown but I suspect that is a b...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
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
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/96801/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F96801%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F96801%2Ffiles
Sign up https://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/96801/files
Reloadhttps://github.com/python/cpython/pull/96801/files
Reloadhttps://github.com/python/cpython/pull/96801/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/96801/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/96801/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
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
markshannonhttps://github.com/markshannon
python:mainhttps://github.com/python/cpython/tree/main
faster-cpython:for-iter-no-pophttps://github.com/faster-cpython/cpython/tree/for-iter-no-pop
Conversation 11 https://github.com/python/cpython/pull/96801
Commits 12 https://github.com/python/cpython/pull/96801/commits
Checks 0 https://github.com/python/cpython/pull/96801/checks
Files changed https://github.com/python/cpython/pull/96801/files
Please reload this pagehttps://github.com/python/cpython/pull/96801/files
GH-96793: Change FOR_ITER to not pop the iterator on exhaustion. https://github.com/python/cpython/pull/96801/files#top
Show all changes 12 commits https://github.com/python/cpython/pull/96801/files
bf44755 Modify FOR_ITER to leave iterator on stack. Work in progress. markshannon Sep 8, 2022 https://github.com/python/cpython/pull/96801/commits/bf44755c347d81ea5725fabe8223ec08392c6a39
5bdef2b Document change to FOR_ITER. markshannon Sep 9, 2022 https://github.com/python/cpython/pull/96801/commits/5bdef2b6189917632cc2c3be1f78341a4090f980
5250ffc Merge branch 'main' into for-iter-no-pop markshannon Sep 13, 2022 https://github.com/python/cpython/pull/96801/commits/5250ffc3ff9ffd32526e639d93af49d44683af39
b807ef8 Add news. markshannon Sep 13, 2022 https://github.com/python/cpython/pull/96801/commits/b807ef85bf4c399cad3c453555b322b0d1977d56
d5dd9b4 Skip over POP_TOP at end of loop in specialized versions of FOR_ITER. markshannon Oct 21, 2022 https://github.com/python/cpython/pull/96801/commits/d5dd9b40545faeb6aa6e7510d68e771655d77320
c9ff8b7 Merge branch 'main' into for-iter-no-pop markshannon Oct 25, 2022 https://github.com/python/cpython/pull/96801/commits/c9ff8b7b043e07a830710b014db4d21d0bf957bc
c5e9d2c Fix up new POP_TOPs to have no location. markshannon Oct 25, 2022 https://github.com/python/cpython/pull/96801/commits/c5e9d2ce0baa69dbf769ef5cc2eed2d88e17614d
687833a Merge branch 'main' into for-iter-no-pop markshannon Oct 26, 2022 https://github.com/python/cpython/pull/96801/commits/687833ac5e6f7931a5e6868f7a575865736e0fac
a575fc8 Add END_FOR instruction markshannon Oct 26, 2022 https://github.com/python/cpython/pull/96801/commits/a575fc8121f6ca4e371fb2f256aba97ef97e57fb
63bd124 Fix up specialization of FOR_ITER markshannon Oct 26, 2022 https://github.com/python/cpython/pull/96801/commits/63bd12463981df34f579ef8b33cfc3deab4e0e7a
611685f Fix tests markshannon Oct 26, 2022 https://github.com/python/cpython/pull/96801/commits/611685fd54a25fd4d222bef500289ae8e9553e03
b6086b6 Add END_FOR to docs. markshannon Oct 26, 2022 https://github.com/python/cpython/pull/96801/commits/b6086b6fc0930191d52047560be77a220c4c2339
Clear filters https://github.com/python/cpython/pull/96801/files
Please reload this pagehttps://github.com/python/cpython/pull/96801/files
Please reload this pagehttps://github.com/python/cpython/pull/96801/files
dis.rst https://github.com/python/cpython/pull/96801/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
pycore_opcode.h https://github.com/python/cpython/pull/96801/files#diff-7b986d4fccffcb2f2af4ec495559b2f0dc2e393e38f95e8ca3ef48e559177530
opcode.h https://github.com/python/cpython/pull/96801/files#diff-1cd1f0bb26c3fbaa279f83ee2bfe1d9072da7af07407111c79039c66034c57ed
_bootstrap_external.py https://github.com/python/cpython/pull/96801/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
opcode.py https://github.com/python/cpython/pull/96801/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
test__opcode.py https://github.com/python/cpython/pull/96801/files#diff-ae73a75dc8c7af5ba9622b7222e7932d84851d64b5732b782f8525c157bfe12e
test_dis.py https://github.com/python/cpython/pull/96801/files#diff-fd7b118a01a9695dfa16eea9381d3c7b0652e1b7b55f51ff052a1f620d175642
2022-09-13-14-07-06.gh-issue-96793.7DLRSm.rst https://github.com/python/cpython/pull/96801/files#diff-fa5188baafd202182825c404bc704e90e5d829af1b9cf0432cb31616a481b1f8
frameobject.c https://github.com/python/cpython/pull/96801/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
test_frozenmain.h https://github.com/python/cpython/pull/96801/files#diff-dcbbf153f77c69fb3a08746516bb9baaf46b9465c941221d1d495123e92cc862
ceval.c https://github.com/python/cpython/pull/96801/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59de
compile.c https://github.com/python/cpython/pull/96801/files#diff-ebc983d9f91e5bcf73500e377ac65e85863c4f77fd5b6b6caf4fcdf7c0f0b057
opcode_targets.h https://github.com/python/cpython/pull/96801/files#diff-d3363a4083b77b9157d0bf07c2e87f3d3464a8b4360d5d23b07bbb23061f007a
specialize.c https://github.com/python/cpython/pull/96801/files#diff-22e653d878778ca28317261f7826545288d02fd9980cf485d0329f28a34993f2
Doc/library/dis.rsthttps://github.com/python/cpython/pull/96801/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
View file https://github.com/faster-cpython/cpython/blob/b6086b6fc0930191d52047560be77a220c4c2339/Doc/library/dis.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/96801/{{ revealButtonHref }}
https://github.com/python/cpython/pull/96801/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
https://github.com/python/cpython/pull/96801/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
https://github.com/python/cpython/pull/96801/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
https://github.com/python/cpython/pull/96801/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
Include/internal/pycore_opcode.hhttps://github.com/python/cpython/pull/96801/files#diff-7b986d4fccffcb2f2af4ec495559b2f0dc2e393e38f95e8ca3ef48e559177530
View file https://github.com/faster-cpython/cpython/blob/b6086b6fc0930191d52047560be77a220c4c2339/Include/internal/pycore_opcode.h
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/96801/files
Include/opcode.hhttps://github.com/python/cpython/pull/96801/files#diff-1cd1f0bb26c3fbaa279f83ee2bfe1d9072da7af07407111c79039c66034c57ed
View file https://github.com/faster-cpython/cpython/blob/b6086b6fc0930191d52047560be77a220c4c2339/Include/opcode.h
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/96801/files
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L260
Lib/importlib/_bootstrap_external.pyhttps://github.com/python/cpython/pull/96801/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
View file https://github.com/faster-cpython/cpython/blob/b6086b6fc0930191d52047560be77a220c4c2339/Lib/importlib/_bootstrap_external.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/96801/{{ revealButtonHref }}
https://github.com/python/cpython/pull/96801/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
https://github.com/python/cpython/pull/96801/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
https://github.com/python/cpython/pull/96801/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
Lib/opcode.pyhttps://github.com/python/cpython/pull/96801/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
View file https://github.com/faster-cpython/cpython/blob/b6086b6fc0930191d52047560be77a220c4c2339/Lib/opcode.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/96801/{{ revealButtonHref }}
https://github.com/python/cpython/pull/96801/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
https://github.com/python/cpython/pull/96801/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
Please reload this pagehttps://github.com/python/cpython/pull/96801/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.