René's URL Explorer Experiment


Title: Do not track immutable tuples in PyTuple_Pack · Issue #139389 · python/cpython · GitHub

Open Graph Title: Do not track immutable tuples in PyTuple_Pack · Issue #139389 · python/cpython

X Title: Do not track immutable tuples in PyTuple_Pack · Issue #139389 · python/cpython

Description: Feature or enhancement Proposal: When we use PyTuple_Pack all objects already well constructed. If we know that they immutable we can skip tracking it in GC, because GC will untrack them eventually. I have a PR ready and benchmark result...

Open Graph Description: Feature or enhancement Proposal: When we use PyTuple_Pack all objects already well constructed. If we know that they immutable we can skip tracking it in GC, because GC will untrack them eventually...

X Description: Feature or enhancement Proposal: When we use PyTuple_Pack all objects already well constructed. If we know that they immutable we can skip tracking it in GC, because GC will untrack them eventually...

Opengraph URL: https://github.com/python/cpython/issues/139389

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Do not track immutable tuples in PyTuple_Pack","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nWhen we use `PyTuple_Pack` all objects already well constructed. If we know that they immutable we can skip tracking it in GC, because GC will untrack them eventually. \n\nI have a PR ready and benchmark results:\n\u003cdetails\u003e\u003csummary\u003eGeometric mean: 1.01x faster (Win11 x64, 11th Gen Intel(R) Core(TM) i5-11600K @ 3.90GHz, 48d0d0dd9733eae4935f2ebd31bef786d8074fc8)\u003c/summary\u003e\n\n\nAll benchmarks:\n===============\n```\n+--------------------------+----------+------------------------+\n| Benchmark                | main     | tuples                 |\n+==========================+==========+========================+\n| async_generators         | 435 ms   | 430 ms: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| asyncio_tcp              | 750 ms   | 756 ms: 1.01x slower   |\n+--------------------------+----------+------------------------+\n| asyncio_tcp_ssl          | 1.91 sec | 1.92 sec: 1.01x slower |\n+--------------------------+----------+------------------------+\n| comprehensions           | 22.1 us  | 21.8 us: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| bench_mp_pool            | 104 ms   | 103 ms: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| bench_thread_pool        | 1.29 ms  | 1.27 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| coroutines               | 28.2 ms  | 27.7 ms: 1.02x faster  |\n+--------------------------+----------+------------------------+\n| coverage                 | 88.5 ms  | 86.3 ms: 1.02x faster  |\n+--------------------------+----------+------------------------+\n| crypto_pyaes             | 90.1 ms  | 86.7 ms: 1.04x faster  |\n+--------------------------+----------+------------------------+\n| deepcopy                 | 310 us   | 307 us: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| deepcopy_memo            | 36.4 us  | 36.1 us: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| deltablue                | 5.19 ms  | 4.85 ms: 1.07x faster  |\n+--------------------------+----------+------------------------+\n| django_template          | 45.5 ms  | 45.8 ms: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| docutils                 | 2.47 sec | 2.45 sec: 1.01x faster |\n+--------------------------+----------+------------------------+\n| dulwich_log              | 86.2 ms  | 86.9 ms: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| fannkuch                 | 449 ms   | 441 ms: 1.02x faster   |\n+--------------------------+----------+------------------------+\n| float                    | 85.3 ms  | 82.5 ms: 1.03x faster  |\n+--------------------------+----------+------------------------+\n| create_gc_cycles         | 1.17 ms  | 1.17 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| gc_traversal             | 2.97 ms  | 2.88 ms: 1.03x faster  |\n+--------------------------+----------+------------------------+\n| generators               | 43.0 ms  | 41.6 ms: 1.03x faster  |\n+--------------------------+----------+------------------------+\n| genshi_text              | 28.9 ms  | 28.7 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| go                       | 160 ms   | 153 ms: 1.04x faster   |\n+--------------------------+----------+------------------------+\n| hexiom                   | 8.39 ms  | 8.13 ms: 1.03x faster  |\n+--------------------------+----------+------------------------+\n| json_dumps               | 8.62 ms  | 8.69 ms: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| logging_format           | 12.5 us  | 12.2 us: 1.02x faster  |\n+--------------------------+----------+------------------------+\n| logging_silent           | 139 ns   | 140 ns: 1.01x slower   |\n+--------------------------+----------+------------------------+\n| logging_simple           | 11.3 us  | 11.1 us: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| mako                     | 14.2 ms  | 14.4 ms: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| mdp                      | 1.47 sec | 1.50 sec: 1.02x slower |\n+--------------------------+----------+------------------------+\n| meteor_contest           | 104 ms   | 102 ms: 1.02x faster   |\n+--------------------------+----------+------------------------+\n| nbody                    | 114 ms   | 113 ms: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| pickle_pure_python       | 439 us   | 436 us: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| pprint_safe_repr         | 953 ms   | 916 ms: 1.04x faster   |\n+--------------------------+----------+------------------------+\n| pprint_pformat           | 1.95 sec | 1.88 sec: 1.04x faster |\n+--------------------------+----------+------------------------+\n| pyflate                  | 506 ms   | 492 ms: 1.03x faster   |\n+--------------------------+----------+------------------------+\n| python_startup           | 28.5 ms  | 27.4 ms: 1.04x faster  |\n+--------------------------+----------+------------------------+\n| python_startup_no_site   | 23.2 ms  | 22.2 ms: 1.05x faster  |\n+--------------------------+----------+------------------------+\n| raytrace                 | 361 ms   | 345 ms: 1.05x faster   |\n+--------------------------+----------+------------------------+\n| regex_compile            | 146 ms   | 146 ms: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| regex_effbot             | 2.03 ms  | 2.02 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| regex_v8                 | 23.9 ms  | 22.7 ms: 1.06x faster  |\n+--------------------------+----------+------------------------+\n| richards                 | 66.1 ms  | 59.9 ms: 1.10x faster  |\n+--------------------------+----------+------------------------+\n| richards_super           | 71.6 ms  | 68.7 ms: 1.04x faster  |\n+--------------------------+----------+------------------------+\n| scimark_fft              | 300 ms   | 294 ms: 1.02x faster   |\n+--------------------------+----------+------------------------+\n| scimark_lu               | 135 ms   | 131 ms: 1.03x faster   |\n+--------------------------+----------+------------------------+\n| scimark_monte_carlo      | 83.3 ms  | 82.4 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| scimark_sor              | 157 ms   | 150 ms: 1.05x faster   |\n+--------------------------+----------+------------------------+\n| scimark_sparse_mat_mult  | 4.27 ms  | 4.35 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| spectral_norm            | 122 ms   | 118 ms: 1.03x faster   |\n+--------------------------+----------+------------------------+\n| sqlglot_optimize         | 60.7 ms  | 60.9 ms: 1.00x slower  |\n+--------------------------+----------+------------------------+\n| sympy_expand             | 501 ms   | 503 ms: 1.00x slower   |\n+--------------------------+----------+------------------------+\n| sympy_sum                | 143 ms   | 144 ms: 1.01x slower   |\n+--------------------------+----------+------------------------+\n| sympy_str                | 287 ms   | 292 ms: 1.02x slower   |\n+--------------------------+----------+------------------------+\n| telco                    | 7.26 ms  | 7.33 ms: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| tomli_loads              | 2.23 sec | 2.25 sec: 1.01x slower |\n+--------------------------+----------+------------------------+\n| typing_runtime_protocols | 189 us   | 185 us: 1.02x faster   |\n+--------------------------+----------+------------------------+\n| unpack_sequence          | 65.4 ns  | 68.7 ns: 1.05x slower  |\n+--------------------------+----------+------------------------+\n| unpickle                 | 13.9 us  | 14.1 us: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| unpickle_pure_python     | 303 us   | 300 us: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| xml_etree_parse          | 130 ms   | 130 ms: 1.01x slower   |\n+--------------------------+----------+------------------------+\n| xml_etree_iterparse      | 107 ms   | 108 ms: 1.01x slower   |\n+--------------------------+----------+------------------------+\n| xml_etree_process        | 79.2 ms  | 78.6 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| Geometric mean           | (ref)    | 1.01x faster           |\n+--------------------------+----------+------------------------+\n```\n\nBenchmark hidden because not significant (20): 2to3, chaos, deepcopy_reduce, genshi_xml, html5lib, json_loads, nqueens, pathlib, pickle, pickle_dict, pickle_list, pidigits, regex_dna, sqlglot_normalize, sqlglot_parse, sqlglot_transpile, sqlite_synth, sympy_integrate, unpickle_list, xml_etree_generate\n\n\n\u003c/details\u003e \n\nIt doesn't hurt performance, but can decrease number of objects in GC to check and untrack.\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-139390\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/sergey-miryanov","@type":"Person","name":"sergey-miryanov"},"datePublished":"2025-09-28T07:40:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/139389/cpython/issues/139389"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ca2df7ed-4b1f-b302-bfc6-08c77d3d280a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCB58:2C3E22:2550B37:308B97B:696B5AD4
html-safe-nonce3231e3bc69147ace56ec6896d8740e217870ed7c35606830f25f216573ef636d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjU4OjJDM0UyMjoyNTUwQjM3OjMwOEI5N0I6Njk2QjVBRDQiLCJ2aXNpdG9yX2lkIjoiODE0Mjg3NTk2NjIzMzU5ODY3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd3f4d864fdb22806d8c8748e885b180f458a2a5057ddbe5651c29d32439acd73
hovercard-subject-tagissue:3461274287
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/139389/issue_layout
twitter:imagehttps://opengraph.githubassets.com/283993300eb3c4a5ea9348c60b56a6137d515cc0e8104e2db29bcd01470e5288/python/cpython/issues/139389
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/283993300eb3c4a5ea9348c60b56a6137d515cc0e8104e2db29bcd01470e5288/python/cpython/issues/139389
og:image:altFeature or enhancement Proposal: When we use PyTuple_Pack all objects already well constructed. If we know that they immutable we can skip tracking it in GC, because GC will untrack them eventually...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesergey-miryanov
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
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
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/139389#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F139389
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%2Fissues%2F139389
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/139389
Reloadhttps://github.com/python/cpython/issues/139389
Reloadhttps://github.com/python/cpython/issues/139389
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/139389
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/issues/139389
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
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/139389
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/139389
Do not track immutable tuples in PyTuple_Packhttps://github.com/python/cpython/issues/139389#top
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/sergey-miryanov
https://github.com/sergey-miryanov
sergey-miryanovhttps://github.com/sergey-miryanov
on Sep 28, 2025https://github.com/python/cpython/issues/139389#issue-3461274287
48d0d0dhttps://github.com/python/cpython/commit/48d0d0dd9733eae4935f2ebd31bef786d8074fc8
GH-139389: Do not track immutable tuples in PyTuple_Pack #139390https://github.com/python/cpython/pull/139390
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
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.