René's URL Explorer Experiment


Title: gh-146455: Fix O(N²) in add_const() after constant folding moved to CFG by zSirius · Pull Request #146456 · python/cpython · GitHub

Open Graph Title: gh-146455: Fix O(N²) in add_const() after constant folding moved to CFG by zSirius · Pull Request #146456 · python/cpython

X Title: gh-146455: Fix O(N²) in add_const() after constant folding moved to CFG by zSirius · Pull Request #146456 · python/cpython

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

Open Graph Description: Fix O(N²) performance regression in add_const() introduced by moving constant folding from AST to CFG optimizer (gh-126835). Problem After gh-130769 moved tuple folding to CFG, fold_tuple_of_consta...

X Description: Fix O(N²) performance regression in add_const() introduced by moving constant folding from AST to CFG optimizer (gh-126835). Problem After gh-130769 moved tuple folding to CFG, fold_tuple_of_consta...

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

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/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:32a5b5d4-8714-4264-67ce-4d6b579a66d8
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC3B0:21DFED:E301A9:11EB970:6B023647
html-safe-nonce839b8fa5f722dd3c805bd1d584a66a760c50a867d36bbc131a89e3b09a657b09
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0IwOjIxREZFRDpFMzAxQTk6MTFFQjk3MDo2QjAyMzY0NyIsInZpc2l0b3JfaWQiOiI1NDU2MzkxMzI0Nzk3NjQwMzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacabe27f79c472a6f8f45df8e37265f0bfc981d7f8dc3ff9a976bcafe334ca8320
hovercard-subject-tagpull_request:3449899504
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///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/cpython/146456/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/b0ef7bf76f5cd80845eb3bc393f1c85ad246d15d56f877f3af4c776d9d45b2ed/python/cpython/pull/146456
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b0ef7bf76f5cd80845eb3bc393f1c85ad246d15d56f877f3af4c776d9d45b2ed/python/cpython/pull/146456
og:image:altFix O(N²) performance regression in add_const() introduced by moving constant folding from AST to CFG optimizer (gh-126835). Problem After gh-130769 moved tuple folding to CFG, fold_tuple_of_consta...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamezSirius
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/146456#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F146456
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%2F146456
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/146456
Reloadhttps://github.com/python/cpython/pull/146456
Reloadhttps://github.com/python/cpython/pull/146456
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
Eclips4https://github.com/Eclips4
python:mainhttps://github.com/python/cpython/tree/main
zSirius:fix-add-const-quadratichttps://github.com/zSirius/cpython/tree/fix-add-const-quadratic
Conversationhttps://github.com/python/cpython/pull/146456
Commits3 (3)https://github.com/python/cpython/pull/146456/commits
Checkshttps://github.com/python/cpython/pull/146456/checks
Files changedhttps://github.com/python/cpython/pull/146456/files
gh-146455: Fix O(N²) in add_const() after constant folding moved to CFGhttps://github.com/python/cpython/pull/146456#top
Eclips4https://github.com/Eclips4
python:mainhttps://github.com/python/cpython/tree/main
zSirius:fix-add-const-quadratichttps://github.com/zSirius/cpython/tree/fix-add-const-quadratic
https://github.com/zSirius
zSiriushttps://github.com/zSirius
Mar 26, 2026https://github.com/python/cpython/pull/146456#issue-4141823838
Please reload this pagehttps://github.com/python/cpython/pull/146456
gh-126835https://github.com/python/cpython/issues/126835
gh-130769https://github.com/python/cpython/pull/130769
gh-129550https://github.com/python/cpython/pull/129550
Performance regression: O(N²) compile time for large constant tuples after const folding moved to CFG #146455https://github.com/python/cpython/issues/146455
Please reload this pagehttps://github.com/python/cpython/pull/146456
pythongh-146455https://github.com/python/cpython/issues/146455
: Fix O(N²) in add_const() after constant folding move…https://github.com/python/cpython/pull/146456/commits/2a6713610f7d15143b3ba2b2497d9c3f8b487deb
2a67136https://github.com/python/cpython/pull/146456/commits/2a6713610f7d15143b3ba2b2497d9c3f8b487deb
pythongh-126835https://github.com/python/cpython/issues/126835
https://github.com/zSirius
zSiriushttps://github.com/zSirius
iritkatrielhttps://github.com/iritkatriel
markshannonhttps://github.com/markshannon
code ownershttps://github.com/python/cpython/blob/8e1469c952fb9db57efdcdce459fd6f78fbaeea3/.github/CODEOWNERS#L234
March 26, 2026 08:39https://github.com/python/cpython/pull/146456#event-23923120274
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Mar 26, 2026https://github.com/python/cpython/pull/146456#issuecomment-4132708693
require a NEWS entryhttps://devguide.python.org/core-developers/committing/#updating-news-and-what-s-new-in-python
blurb_ithttps://blurb-it.herokuapp.com
blurbhttps://pypi.org/project/blurb/
Please reload this pagehttps://github.com/python/cpython/pull/146456
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Mar 26, 2026 https://github.com/python/cpython/pull/146456#ref-issue-4141784480
Performance regression: O(N²) compile time for large constant tuples after const folding moved to CFG #146455 https://github.com/python/cpython/issues/146455
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22
Mar 26, 2026https://github.com/python/cpython/pull/146456#event-23923124797
📜🤖 Added by blurb_it.https://github.com/python/cpython/pull/146456/commits/cebc9fc9a01910c381744bf8b867f60bc60d3cdf
cebc9fchttps://github.com/python/cpython/pull/146456/commits/cebc9fc9a01910c381744bf8b867f60bc60d3cdf
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
March 26, 2026 13:06https://github.com/python/cpython/pull/146456#event-23932516028
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
Apr 21, 2026 https://github.com/python/cpython/pull/146456#pullrequestreview-4149278742
View reviewed changes https://github.com/python/cpython/pull/146456/files/cebc9fc9a01910c381744bf8b867f60bc60d3cdf
Python/flowgraph.chttps://github.com/python/cpython/pull/146456/files/cebc9fc9a01910c381744bf8b867f60bc60d3cdf#diff-3cbf15668c31488528b7ab0f903c674a0ecf550f4f53c1be6cf8cd965246c2a0
Eclips4https://github.com/Eclips4
Apr 21, 2026https://github.com/python/cpython/pull/146456#discussion_r3118887841
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/146456
zSiriushttps://github.com/zSirius
Apr 22, 2026https://github.com/python/cpython/pull/146456#discussion_r3121939851
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/146456
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
Apr 21, 2026 https://github.com/python/cpython/pull/146456#pullrequestreview-4149280816
View reviewed changes https://github.com/python/cpython/pull/146456/files/cebc9fc9a01910c381744bf8b867f60bc60d3cdf
Python/flowgraph.chttps://github.com/python/cpython/pull/146456/files/cebc9fc9a01910c381744bf8b867f60bc60d3cdf#diff-3cbf15668c31488528b7ab0f903c674a0ecf550f4f53c1be6cf8cd965246c2a0
Eclips4https://github.com/Eclips4
Apr 21, 2026https://github.com/python/cpython/pull/146456#discussion_r3118889955
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/146456
Remove unnecessary commentshttps://github.com/python/cpython/pull/146456/commits/ef2e494cc8f29b049134535fcedc590a9b40063a
ef2e494https://github.com/python/cpython/pull/146456/commits/ef2e494cc8f29b049134535fcedc590a9b40063a
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
April 22, 2026 16:21https://github.com/python/cpython/pull/146456#event-24763545811
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
Apr 26, 2026 https://github.com/python/cpython/pull/146456#ref-issue-4299535918
sets with >30 elements not constant-folded in in/not in and for loops #148817 https://github.com/python/cpython/issues/148817
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
Apr 26, 2026https://github.com/python/cpython/pull/146456#issuecomment-4321978298
Please reload this pagehttps://github.com/python/cpython/pull/146456
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
Apr 26, 2026https://github.com/python/cpython/pull/146456#issuecomment-4321996598
Please reload this pagehttps://github.com/python/cpython/pull/146456
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
5d41632https://github.com/python/cpython/commit/5d416324c56cd6f262fa123f41b97b48631bea79
Apr 26, 2026https://github.com/python/cpython/pull/146456#event-24879218082
Please reload this pagehttps://github.com/python/cpython/pull/146456
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22
Apr 26, 2026https://github.com/python/cpython/pull/146456#event-24879218667
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
Apr 26, 2026https://github.com/python/cpython/pull/146456#issuecomment-4322000259
@zSiriushttps://github.com/zSirius
Please reload this pagehttps://github.com/python/cpython/pull/146456
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
needs backport to 3.14 https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22needs%20backport%20to%203.14%22
Apr 26, 2026https://github.com/python/cpython/pull/146456#event-24879224642
https://github.com/apps/miss-islington-app
miss-islington-apphttps://github.com/apps/miss-islington-app
Apr 26, 2026https://github.com/python/cpython/pull/146456#issuecomment-4322001052
@zSiriushttps://github.com/zSirius
@Eclips4https://github.com/Eclips4
Please reload this pagehttps://github.com/python/cpython/pull/146456
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Apr 26, 2026https://github.com/python/cpython/pull/146456#issuecomment-4322001288
GH-149011https://github.com/python/cpython/pull/149011
3.14 branchhttps://github.com/python/cpython/tree/3.14
Please reload this pagehttps://github.com/python/cpython/pull/146456
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
needs backport to 3.14 https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22needs%20backport%20to%203.14%22
Apr 26, 2026https://github.com/python/cpython/pull/146456#event-24879226537
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
Apr 26, 2026https://github.com/python/cpython/pull/146456#issuecomment-4322004155
@zSiriushttps://github.com/zSirius
#149011https://github.com/python/cpython/pull/149011
Please reload this pagehttps://github.com/python/cpython/pull/146456
https://github.com/iritkatriel
iritkatrielhttps://github.com/iritkatriel
Apr 26, 2026 https://github.com/python/cpython/pull/146456#pullrequestreview-4176905554
View reviewed changes https://github.com/python/cpython/pull/146456/files/ef2e494cc8f29b049134535fcedc590a9b40063a
Python/flowgraph.chttps://github.com/python/cpython/pull/146456/files/ef2e494cc8f29b049134535fcedc590a9b40063a#diff-3cbf15668c31488528b7ab0f903c674a0ecf550f4f53c1be6cf8cd965246c2a0
iritkatrielhttps://github.com/iritkatriel
Apr 26, 2026https://github.com/python/cpython/pull/146456#discussion_r3143460829
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/146456
Eclips4https://github.com/Eclips4
Apr 26, 2026 https://github.com/python/cpython/pull/146456#ref-commit-78c5e54
https://github.com/miss-islington
https://github.com/zSirius
[3.14]https://github.com/python/cpython/commit/78c5e54b4fd5798d8b74b901c34539bb09a5a064
gh-146455https://github.com/python/cpython/issues/146455
: Fix O(N²) in add_const() after constant folding mov…https://github.com/python/cpython/commit/78c5e54b4fd5798d8b74b901c34539bb09a5a064
78c5e54https://github.com/python/cpython/commit/78c5e54b4fd5798d8b74b901c34539bb09a5a064
GH-146456https://github.com/python/cpython/pull/146456
#149011https://github.com/python/cpython/pull/149011
gh-146455https://github.com/python/cpython/issues/146455
GH-146456https://github.com/python/cpython/pull/146456
gh-126835https://github.com/python/cpython/issues/126835
5d41632https://github.com/python/cpython/commit/5d416324c56cd6f262fa123f41b97b48631bea79
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F146456
https://github.com/iritkatriel
iritkatriel https://github.com/iritkatriel
https://github.com/python/cpython/pull/146456/files/ef2e494cc8f29b049134535fcedc590a9b40063a
https://github.com/markshannon
markshannon https://github.com/markshannon
https://github.com/Eclips4
Eclips4 https://github.com/Eclips4
Please reload this pagehttps://github.com/python/cpython/pull/146456
Please reload this pagehttps://github.com/python/cpython/pull/146456
https://github.com/zSirius
https://github.com/Eclips4
https://github.com/iritkatriel
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.