René's URL Explorer Experiment


Title: GH-93533: Shrink the `LOAD_ATTR` caches by brandtbucher · Pull Request #103014 · python/cpython · GitHub

Open Graph Title: GH-93533: Shrink the `LOAD_ATTR` caches by brandtbucher · Pull Request #103014 · python/cpython

X Title: GH-93533: Shrink the `LOAD_ATTR` caches by brandtbucher · Pull Request #103014 · python/cpython

Description: This adds a fixed array of cached methods to the PyTypeObject struct. This approach saves memory if there are ~23x more LOAD_ATTR sites than there are types. A size of 16 was chosen because: A siz...

Open Graph Description: This adds a fixed array of cached methods to the PyTypeObject struct. This approach saves memory if there are ~23x more LOAD_ATTR sites than there are types. A size of 16 was chosen because: A siz...

X Description: This adds a fixed array of cached methods to the PyTypeObject struct. This approach saves memory if there are ~23x more LOAD_ATTR sites than there are types. A size of 16 was chosen because: A siz...

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

X: @github

direct link

Domain: github.com

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:e504947e-69ed-b7ef-e144-276a1c3fcc0b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE204:8D142:27B516D:341C561:696B1F5D
html-safe-nonce3338d7dc5f0a98f4a0b7323dfb773c0ffe1e26a991df5a42286037c898f387a0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjA0OjhEMTQyOjI3QjUxNkQ6MzQxQzU2MTo2OTZCMUY1RCIsInZpc2l0b3JfaWQiOiI2MzI1MjU3MjM4NTA3MTA4NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac28955913471e4d84c72b49d3ba6cb8fffe27d9cb2efb2701c36dbdffc511dd11
hovercard-subject-tagpull_request:1289571205
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/103014/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/26fdec7c690be0d6d2b48adfe0e654f52a339c5263b6749ec8d3bb4d87f7f331/python/cpython/pull/103014
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/26fdec7c690be0d6d2b48adfe0e654f52a339c5263b6749ec8d3bb4d87f7f331/python/cpython/pull/103014
og:image:altThis adds a fixed array of cached methods to the PyTypeObject struct. This approach saves memory if there are ~23x more LOAD_ATTR sites than there are types. A size of 16 was chosen because: A siz...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebrandtbucher
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/pull/103014#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F103014
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%2F103014
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%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/103014
Reloadhttps://github.com/python/cpython/pull/103014
Reloadhttps://github.com/python/cpython/pull/103014
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/103014
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/103014
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
Jump to bottomhttps://github.com/python/cpython/pull/103014#issue-comment-box
brandtbucherhttps://github.com/brandtbucher
python:mainhttps://github.com/python/cpython/tree/main
brandtbucher:type-cache-fixedhttps://github.com/brandtbucher/cpython/tree/type-cache-fixed
GH-93533: Shrink the LOAD_ATTR caches https://github.com/python/cpython/pull/103014#top
brandtbucherhttps://github.com/brandtbucher
python:mainhttps://github.com/python/cpython/tree/main
brandtbucher:type-cache-fixedhttps://github.com/brandtbucher/cpython/tree/type-cache-fixed
Conversation 6 https://github.com/python/cpython/pull/103014
Commits 7 https://github.com/python/cpython/pull/103014/commits
Checks 0 https://github.com/python/cpython/pull/103014/checks
Files changed https://github.com/python/cpython/pull/103014/files
Please reload this pagehttps://github.com/python/cpython/pull/103014
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
Mar 24, 2023https://github.com/python/cpython/pull/103014#issue-1639981293
Please reload this pagehttps://github.com/python/cpython/pull/103014
1% slowerhttps://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20230323-3.12.0a6%2B-bde6bec/bm-20230323-linux-x86_64-brandtbucher-type_cache_fixed-3.12.0a6%2B-bde6bec-vs-base.png
81.0% LOAD_ATTR hit ratehttps://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20230323-3.12.0a6%2B-bde6bec/bm-20230323-azure-x86_64-brandtbucher-type_cache_fixed-3.12.0a6%2B-bde6bec-pystats.md
0% fasterhttps://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20230323-3.12.0a6%2B-212046c/bm-20230323-linux-x86_64-brandtbucher-type_cache_fixed-3.12.0a6%2B-212046c-vs-base.png
82.2% LOAD_ATTR hit ratehttps://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20230323-3.12.0a6%2B-212046c/bm-20230323-azure-x86_64-brandtbucher-type_cache_fixed-3.12.0a6%2B-212046c-pystats.md
0% fasterhttps://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20230323-3.12.0a6%2B-cc70763/bm-20230323-linux-x86_64-brandtbucher-type_cache_fixed_lar-3.12.0a6%2B-cc70763-vs-base.png
82.6% LOAD_ATTR hit ratehttps://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20230323-3.12.0a6%2B-cc70763/bm-20230323-azure-x86_64-brandtbucher-type_cache_fixed_lar-3.12.0a6%2B-cc70763-pystats.md
1% slowerhttps://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20230322-3.12.0a6%2B-c87e8bd/bm-20230322-linux-x86_64-brandtbucher-type_cache-3.12.0a6%2B-c87e8bd-vs-base.png
The inline cache for LOAD_ATTR is too large. #93533https://github.com/python/cpython/issues/93533
Please reload this pagehttps://github.com/python/cpython/pull/103014
brandtbucherhttps://github.com/brandtbucher
March 22, 2023 18:29https://github.com/python/cpython/pull/103014#commits-pushed-c87e8bd
https://github.com/brandtbucher
Stick a small, resizable cache on all typeshttps://github.com/python/cpython/pull/103014/commits/c87e8bd0f377c049f9f8448b2f047cf4798dc6df
c87e8bdhttps://github.com/python/cpython/pull/103014/commits/c87e8bd0f377c049f9f8448b2f047cf4798dc6df
https://github.com/brandtbucher
Try a bigger starting cache size (8 instead of 1)https://github.com/python/cpython/pull/103014/commits/0e21f47cc8f6943ee7f53bee5b5e43faec814e03
0e21f47https://github.com/python/cpython/pull/103014/commits/0e21f47cc8f6943ee7f53bee5b5e43faec814e03
https://github.com/brandtbucher
Try a fixed cache sizehttps://github.com/python/cpython/pull/103014/commits/bde6bec49a139ad2ea6f78790c9b9cd0889777af
bde6bechttps://github.com/python/cpython/pull/103014/commits/bde6bec49a139ad2ea6f78790c9b9cd0889777af
https://github.com/brandtbucher
Bump the size to 16https://github.com/python/cpython/pull/103014/commits/212046ce2f6fa3e76a46d84cba3fdf81d933cc5c
212046chttps://github.com/python/cpython/pull/103014/commits/212046ce2f6fa3e76a46d84cba3fdf81d933cc5c
https://github.com/brandtbucher
Catch up with mainhttps://github.com/python/cpython/pull/103014/commits/1ee7d47314d41a489f10f68c71dadc4d699dba97
1ee7d47https://github.com/python/cpython/pull/103014/commits/1ee7d47314d41a489f10f68c71dadc4d699dba97
https://github.com/brandtbucher
Blurb addhttps://github.com/python/cpython/pull/103014/commits/cdc31897f9e1b584b2ebe12cf80e551e1dba0df2
cdc3189https://github.com/python/cpython/pull/103014/commits/cdc31897f9e1b584b2ebe12cf80e551e1dba0df2
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
Mar 24, 2023https://github.com/python/cpython/pull/103014#event-8842442717
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
Mar 24, 2023https://github.com/python/cpython/pull/103014#event-8842442767
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
markshannonhttps://github.com/markshannon
code ownerhttps://github.com/python/cpython/blob/f2e5a6ee628502d307a97f587788d7022a200229/.github/CODEOWNERS#L22
March 24, 2023 20:18https://github.com/python/cpython/pull/103014#event-8842442832
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
Mar 24, 2023 https://github.com/python/cpython/pull/103014#ref-issue-1261699969
The inline cache for LOAD_ATTR is too large. #93533 https://github.com/python/cpython/issues/93533
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Mar 24, 2023https://github.com/python/cpython/pull/103014#event-8842443410
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
Mar 24, 2023https://github.com/python/cpython/pull/103014#event-8842443627
https://github.com/TeamSpen210
TeamSpen210https://github.com/TeamSpen210
Mar 24, 2023https://github.com/python/cpython/pull/103014#issuecomment-1483478895
Please reload this pagehttps://github.com/python/cpython/pull/103014
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
Mar 24, 2023https://github.com/python/cpython/pull/103014#issuecomment-1483519927
Please reload this pagehttps://github.com/python/cpython/pull/103014
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
Mar 24, 2023https://github.com/python/cpython/pull/103014#issuecomment-1483554669
@ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Please reload this pagehttps://github.com/python/cpython/pull/103014
https://github.com/hugovk
Merge branch 'main' into type-cache-fixedhttps://github.com/python/cpython/pull/103014/commits/6934d55172b95e0d862d00ba0dcf90c3bbeca25f
6934d55https://github.com/python/cpython/pull/103014/commits/6934d55172b95e0d862d00ba0dcf90c3bbeca25f
https://github.com/hugovk
hugovkhttps://github.com/hugovk
Mar 25, 2023https://github.com/python/cpython/pull/103014#issuecomment-1483751195
#103019https://github.com/python/cpython/pull/103019
Please reload this pagehttps://github.com/python/cpython/pull/103014
https://github.com/markshannon
markshannonhttps://github.com/markshannon
Mar 25, 2023https://github.com/python/cpython/pull/103014#issuecomment-1483791236
Please reload this pagehttps://github.com/python/cpython/pull/103014
Please reload this pagehttps://github.com/python/cpython/pull/103014
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
Mar 27, 2023https://github.com/python/cpython/pull/103014#issuecomment-1485637578
Please reload this pagehttps://github.com/python/cpython/pull/103014
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
Mar 27, 2023https://github.com/python/cpython/pull/103014#event-8857079541
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%2F103014
https://github.com/markshannon
markshannon https://github.com/markshannon
https://github.com/brandtbucher
brandtbucher https://github.com/brandtbucher
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
Please reload this pagehttps://github.com/python/cpython/pull/103014
https://github.com/brandtbucher
https://github.com/TeamSpen210
https://github.com/hugovk
https://github.com/markshannon
https://github.com/bedevere-bot
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.