René's URL Explorer Experiment


Title: gh-148653: refactored marshal for cycle safety and performance by mjbommar · Pull Request #148700 · python/cpython · GitHub

Open Graph Title: gh-148653: refactored marshal for cycle safety and performance by mjbommar · Pull Request #148700 · python/cpython

X Title: gh-148653: refactored marshal for cycle safety and performance by mjbommar · Pull Request #148700 · python/cpython

Description: This an experimental rewrite of marshal based on conversation with @serhiy-storchaka in #148652 and #148653. Includes a number of extra docs and data generators that are provided only for reference during discussion. So far it's green for me on test suite but need to dig in further and assume @serhiy-storchaka will have better intuition than me on any behavior or performance regressions. In my first attempt, we hit minor single digit performance regressions in the loads path, unsurprisingly concentrated in the complicated cases. Second attempt with improved performance coming in an hour or so. (edit: now faster than HEAD with real performance and correctness gains) Assisted by GPT-5.4 xhigh and Opus 4.7 Issue: gh-148653

Open Graph Description: This an experimental rewrite of marshal based on conversation with @serhiy-storchaka in #148652 and #148653. Includes a number of extra docs and data generators that are provided only for reference...

X Description: This an experimental rewrite of marshal based on conversation with @serhiy-storchaka in #148652 and #148653. Includes a number of extra docs and data generators that are provided only for reference...

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

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:39fe1f08-9957-e7b8-0fa0-51dcc31f8ef5
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9A48:174933:714B:950A:6B021E5B
html-safe-noncef019ed577cc2a6f3812a49a25fb6863247bf1ea97bbac06cc31e91c5d5b08cfd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTQ4OjE3NDkzMzo3MTRCOjk1MEE6NkIwMjFFNUIiLCJ2aXNpdG9yX2lkIjoiNzE0Njk4MTQwODA0Nzc2NzEzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfa3bb8f8b0524fac0dd9121fa97b3c0f240098ed6ca67be127bd717c491bfe7f
hovercard-subject-tagpull_request:3546798370
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/148700/files
twitter:imagehttps://avatars.githubusercontent.com/u/85053?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/85053?s=400&v=4
og:image:altThis an experimental rewrite of marshal based on conversation with @serhiy-storchaka in #148652 and #148653. Includes a number of extra docs and data generators that are provided only for reference...
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/148700/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F148700%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%2F148700%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/148700/files
Reloadhttps://github.com/python/cpython/pull/148700/files
Reloadhttps://github.com/python/cpython/pull/148700/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
mjbommarhttps://github.com/mjbommar
python:mainhttps://github.com/python/cpython/tree/main
mjbommar:marshal-safe-cycle-designhttps://github.com/mjbommar/cpython/tree/marshal-safe-cycle-design
Conversation 8 https://github.com/python/cpython/pull/148700
Commits 6 https://github.com/python/cpython/pull/148700/commits
Checks 50 https://github.com/python/cpython/pull/148700/checks
Files changed https://github.com/python/cpython/pull/148700/files
Please reload this pagehttps://github.com/python/cpython/pull/148700/files
gh-148653: refactored marshal for cycle safety and performance https://github.com/python/cpython/pull/148700/files#top
Show all changes 6 commits https://github.com/python/cpython/pull/148700/files
7c214ea gh-148653: Fix SIGSEGV in marshal.loads for self-referencing tuples mjbommar Apr 16, 2026 https://github.com/python/cpython/pull/148700/commits/7c214ea52efbcf12261128b458db8fe025cbc61b
3835149 marshal: preserve safe recursive hashable refs mjbommar Apr 17, 2026 https://github.com/python/cpython/pull/148700/commits/38351499d915a61a71e9eeefe7b7af571c3a4e21
eb1c4b7 marshal: add benchmark summary note mjbommar Apr 17, 2026 https://github.com/python/cpython/pull/148700/commits/eb1c4b7ce46a2d49710e7ac687d5e59bb6b83207
4aaf064 marshal: recover loads regression with raw refs table + tagged state mjbommar Apr 17, 2026 https://github.com/python/cpython/pull/148700/commits/4aaf064344d59b668b1e22ee05acee86c4dae9c0
e931b7e marshal: add final validation section + raw perf data folder mjbommar Apr 17, 2026 https://github.com/python/cpython/pull/148700/commits/e931b7ec45c21048389b4235d44a6220ceb9bdfc
4c18f3a marshal: add third-party + fuzz validation section to perf diary mjbommar Apr 17, 2026 https://github.com/python/cpython/pull/148700/commits/4c18f3a8a70184577c0b46d51532341b3615e541
Clear filters https://github.com/python/cpython/pull/148700/files
Please reload this pagehttps://github.com/python/cpython/pull/148700/files
Please reload this pagehttps://github.com/python/cpython/pull/148700/files
pycore_dict.h https://github.com/python/cpython/pull/148700/files#diff-47692c69ef97b2d7cf05ad8e0fa2024b575af96abf9bbc5486f71156ab67ede4
test_marshal.py https://github.com/python/cpython/pull/148700/files#diff-8201bccab835556960180c83492e252bf18bc045bc0dfacf9b290613a4d46269
2026-04-16-12-51-32.gh-issue-148653.G0_AMQ.rst https://github.com/python/cpython/pull/148700/files#diff-eff75c2cba33fabc606eb71bc754a0ef7cadde54d53b89fbcaf7f386da4a91fc
README.md https://github.com/python/cpython/pull/148700/files#diff-1f18845cf70052a17b488b6f2ad3e3ef68f1d08ea7137453d71ac62ad2ac8792
exp0-run1.json https://github.com/python/cpython/pull/148700/files#diff-0114048520b0ec928b4e6689ec9b7215a67556e170db1893be377ccb4238a083
exp0-run2.json https://github.com/python/cpython/pull/148700/files#diff-bf3013cfff2aab36ac18c1692ec924985788f3ade33e53fbbd53ff5c9a2052a9
exp0-run3.json https://github.com/python/cpython/pull/148700/files#diff-7201aa05d4b187592a47bb7262d5c5c9807c27f86308225711e3439248b3cbff
exp1-run1.json https://github.com/python/cpython/pull/148700/files#diff-e4c3246887b1c9030e2290d89e3e34bcd484a55adfb2acf9b59bc9f99f3ea024
exp1-run2.json https://github.com/python/cpython/pull/148700/files#diff-6b6f8895dfa8696435377d3149acff630f13ec01ce70b5344d2b059832b5ef4f
exp1-run3.json https://github.com/python/cpython/pull/148700/files#diff-1c8ff9ef99edd1cb33dd7c02c1cbfca662d20a25207323656bbed862224d4671
exp2-run1.json https://github.com/python/cpython/pull/148700/files#diff-1c238b9eacfb6fb84367c39d790827cb369086263a7165f32fa45cf196a147f6
exp2-run2.json https://github.com/python/cpython/pull/148700/files#diff-46721ab937e95c5ede279c7434ccbfbc2e17a04173c0950cab1c3eb2f95ea99b
exp2-run3.json https://github.com/python/cpython/pull/148700/files#diff-fd3507f470e71dcdf4977447d62be0be614878376e797a9f363ffeea8703fdc0
exp3-run1.json https://github.com/python/cpython/pull/148700/files#diff-2efe1e670ba0acd2173f276b3310228a9d398d58dfbb674c7396629a07c52b33
exp3-run2.json https://github.com/python/cpython/pull/148700/files#diff-ed7a310abbe22eb028250f9fd96bb47b26b95ecbdf53cf3e5758fecfe8371829
exp3-run3.json https://github.com/python/cpython/pull/148700/files#diff-4fefa95fa9532e01e791bc0ae8dbfd7d8bfe9a61412082c7b2e4827c65845343
exp4-run1.json https://github.com/python/cpython/pull/148700/files#diff-cecbea10afff143ab2d408a860294a69bf9267a777ae778784334dba1be4c025
exp4-run2.json https://github.com/python/cpython/pull/148700/files#diff-f241ccb2aed0c020d01b4c202c2f0e396f21a874299218c28960b6e4260ee0ba
exp4-run3.json https://github.com/python/cpython/pull/148700/files#diff-fa1352831973d0b8984412e9f3d73e3aa75acf64aba8478d6569071f1aa86274
exp5-run1.json https://github.com/python/cpython/pull/148700/files#diff-b4e5891f2bcdf80b049aacfdd97f16a92e142fcc049d8f8a07c075b58beb0edf
exp5-run2.json https://github.com/python/cpython/pull/148700/files#diff-557c569d87565d6cb967a6447f030d6e7dd654636f970fbde9ab628f968e8ceb
exp5-run3.json https://github.com/python/cpython/pull/148700/files#diff-4bf29c8a8646d907151593f9341615b7cbd7cb987da6845dbd0c30c86f273b2d
exp6-run1.json https://github.com/python/cpython/pull/148700/files#diff-027aaad712095a352f68d3bbc332cbaddd61c635a53a13190c08b84dd9ac096d
exp6-run2.json https://github.com/python/cpython/pull/148700/files#diff-e05d5734a0b9cd009583b3fc8891a93a2b2263f46a03d2e0ef475a1e1ca4f5fd
exp6-run3.json https://github.com/python/cpython/pull/148700/files#diff-9c97266eb0a344ed058687ead31b5e24cc1475d3484ff8f5e7e0d77c27b4a0b9
exp7-run1.json https://github.com/python/cpython/pull/148700/files#diff-6c91a82d101256bea9bbbc10e7e35b6b77458fc1fcafb8be71326d6e9a48475e
exp7-run2.json https://github.com/python/cpython/pull/148700/files#diff-394ce4aee64ea0e026245ce74bd21661e6124f99d497c742902c7003a44c2c76
exp7-run3.json https://github.com/python/cpython/pull/148700/files#diff-782e9364039d25340cd86a84db28475f352a79c9869aba95011b37256f49f7b5
exp8-run1.json https://github.com/python/cpython/pull/148700/files#diff-859dc97ec3f6c69cc185b975ef296249dde9c945eb73c5754e4691611ffa3081
exp8-run2.json https://github.com/python/cpython/pull/148700/files#diff-7b4fe8d1dc25a5b371261bd4d281c00868a4d469c6faad7b35e63cfcd37723ca
exp8-run3.json https://github.com/python/cpython/pull/148700/files#diff-bb2e1a642e23e54a26799fd50f9ddc52685ea83acf09acd33cfb1e59f92ef7d4
exp9-run1.json https://github.com/python/cpython/pull/148700/files#diff-9bf8c70fe05554a1988aeb63063fb276598621b42a7e9daa02db92846e649b23
exp9-run2.json https://github.com/python/cpython/pull/148700/files#diff-f9b58785bca4e9afbce2ff40e8550823cfdadc1d5a20d11337ba44658b354c59
exp9-run3.json https://github.com/python/cpython/pull/148700/files#diff-37eb9044dfcd481ec1edce58ba322c04cf38026a30bf0ecebc5b8036094bb796
expC-run1.json https://github.com/python/cpython/pull/148700/files#diff-5387d0ae186cc5a3aca81106d8fd25e3f3d29f1f2313b794e993a9a69adde9ff
expC-run2.json https://github.com/python/cpython/pull/148700/files#diff-6edd2264d1fd887287dbcfb9f5ddc0311b11b3a1d7195924b8c3fe1d93eb055f
expC-run3.json https://github.com/python/cpython/pull/148700/files#diff-cbcdf5100906b4c480f30cde37f76e786609294536ce03677c3c267625767dc6
final-head-run1.json https://github.com/python/cpython/pull/148700/files#diff-a9904606ebf926cdc5fe985b16bfda9af47f61c05d6d00cb7dc1c22098830cc7
final-head-run2.json https://github.com/python/cpython/pull/148700/files#diff-3d6da93958ea3711f8d50b7b99e25cf222de01a64025477507b5774a98608000
final-head-run3.json https://github.com/python/cpython/pull/148700/files#diff-db227886cc15358f86a38709359b0fed7412948d2cc2f59ddf139a5f3af667f0
pyperf-slice-baseline.json https://github.com/python/cpython/pull/148700/files#diff-11565c46ebaf778e164a004186a674e9d4de830e1fe878e257348cae66975478
pyperf-slice-current.json https://github.com/python/cpython/pull/148700/files#diff-98cab819dd86e8b39e226164c21b7d25af6c587aeab67d9d9b869f19b4062208
marshal-perf-diary.md https://github.com/python/cpython/pull/148700/files#diff-b89fe8d9483fca8859fad1c0efe6d622339c2ab2d518c3cf23364e00044fe4c4
marshal-recursive-ref-design.md https://github.com/python/cpython/pull/148700/files#diff-da4782a4086bc4abbc803a3efceb5c96a673dfc5f25364ae23c30f08c77ec9df
dictobject.c https://github.com/python/cpython/pull/148700/files#diff-b08a47ddc5bc20b2e99ac2e5aa199ca24a56b994e7bc64e918513356088c20ae
marshal.c https://github.com/python/cpython/pull/148700/files#diff-46d545a32ea7176926cf1a963f25cdac2cf1c8098b3e020ccc77b63b2149d760
Include/internal/pycore_dict.hhttps://github.com/python/cpython/pull/148700/files#diff-47692c69ef97b2d7cf05ad8e0fa2024b575af96abf9bbc5486f71156ab67ede4
View file https://github.com/mjbommar/cpython/blob/4c18f3a8a70184577c0b46d51532341b3615e541/Include/internal/pycore_dict.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/148700/{{ revealButtonHref }}
https://github.com/python/cpython/pull/148700/files#diff-47692c69ef97b2d7cf05ad8e0fa2024b575af96abf9bbc5486f71156ab67ede4
https://github.com/python/cpython/pull/148700/files#diff-47692c69ef97b2d7cf05ad8e0fa2024b575af96abf9bbc5486f71156ab67ede4
Lib/test/test_marshal.pyhttps://github.com/python/cpython/pull/148700/files#diff-8201bccab835556960180c83492e252bf18bc045bc0dfacf9b290613a4d46269
View file https://github.com/mjbommar/cpython/blob/4c18f3a8a70184577c0b46d51532341b3615e541/Lib/test/test_marshal.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/148700/{{ revealButtonHref }}
https://github.com/python/cpython/pull/148700/files#diff-8201bccab835556960180c83492e252bf18bc045bc0dfacf9b290613a4d46269
https://github.com/python/cpython/pull/148700/files#diff-8201bccab835556960180c83492e252bf18bc045bc0dfacf9b290613a4d46269
https://github.com/python/cpython/pull/148700/files#diff-8201bccab835556960180c83492e252bf18bc045bc0dfacf9b290613a4d46269
Misc/NEWS.d/next/Library/2026-04-16-12-51-32.gh-issue-148653.G0_AMQ.rsthttps://github.com/python/cpython/pull/148700/files#diff-eff75c2cba33fabc606eb71bc754a0ef7cadde54d53b89fbcaf7f386da4a91fc
View file https://github.com/mjbommar/cpython/blob/4c18f3a8a70184577c0b46d51532341b3615e541/Misc/NEWS.d/next/Library/2026-04-16-12-51-32.gh-issue-148653.G0_AMQ.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/148700/{{ revealButtonHref }}
Please reload this pagehttps://github.com/python/cpython/pull/148700/files
Please reload this pagehttps://github.com/python/cpython/pull/148700/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.