René's URL Explorer Experiment


Title: gh-103193: cache calls to `inspect._shadowed_dict` in `inspect.getattr_static` by AlexWaygood · Pull Request #104267 · python/cpython · GitHub

Open Graph Title: gh-103193: cache calls to `inspect._shadowed_dict` in `inspect.getattr_static` by AlexWaygood · Pull Request #104267 · python/cpython

X Title: gh-103193: cache calls to `inspect._shadowed_dict` in `inspect.getattr_static` by AlexWaygood · Pull Request #104267 · python/cpython

Description: EDIT: These performance numbers are out of date with the current PR; read further down the thread for the up-to-date numbers. This dramatically speeds up calls to inspect.getattr_static. Here are b...

Open Graph Description: EDIT: These performance numbers are out of date with the current PR; read further down the thread for the up-to-date numbers. This dramatically speeds up calls to inspect.getattr_static. Here are b...

X Description: EDIT: These performance numbers are out of date with the current PR; read further down the thread for the up-to-date numbers. This dramatically speeds up calls to inspect.getattr_static. Here are b...

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

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:57f5d91f-963c-782c-c0f7-e1ffd62b1b82
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD29E:2F6228:32E57A:44DC9C:696A2017
html-safe-nonceadfb1aba699bf2b988abbd389fc7568452944bc5858c4bd53c79fbf88980fc50
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjlFOjJGNjIyODozMkU1N0E6NDREQzlDOjY5NkEyMDE3IiwidmlzaXRvcl9pZCI6Ijg4NzU4MTM2NTU3MTQzNDA4ODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacec6a993b721c3b827782ddcfca11f0f218f449b34a812244ad7e7d8e465d4359
hovercard-subject-tagpull_request:1341166031
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/104267/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/094c708dae1f63181d5b12eb2818a8b3ca8da50dd30aa38e42675e53b996cddb/python/cpython/pull/104267
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/094c708dae1f63181d5b12eb2818a8b3ca8da50dd30aa38e42675e53b996cddb/python/cpython/pull/104267
og:image:altEDIT: These performance numbers are out of date with the current PR; read further down the thread for the up-to-date numbers. This dramatically speeds up calls to inspect.getattr_static. Here are b...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAlexWaygood
hostnamegithub.com
expected-hostnamegithub.com
None014f3d193f36b7d393f88ca22d06fbacd370800b40a547c1ea67291e02dc8ea3
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
released515f6f09fa57a93bf90355cb894eb84ca4f458f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/104267#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F104267
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%2F104267
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/104267
Reloadhttps://github.com/python/cpython/pull/104267
Reloadhttps://github.com/python/cpython/pull/104267
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/104267
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/104267
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/104267#issue-comment-box
AlexWaygoodhttps://github.com/AlexWaygood
python:mainhttps://github.com/python/cpython/tree/main
AlexWaygood:simple-lru-cachehttps://github.com/AlexWaygood/cpython/tree/simple-lru-cache
gh-103193: cache calls to inspect._shadowed_dict in inspect.getattr_static https://github.com/python/cpython/pull/104267#top
AlexWaygoodhttps://github.com/AlexWaygood
python:mainhttps://github.com/python/cpython/tree/main
AlexWaygood:simple-lru-cachehttps://github.com/AlexWaygood/cpython/tree/simple-lru-cache
Conversation 9 https://github.com/python/cpython/pull/104267
Commits 4 https://github.com/python/cpython/pull/104267/commits
Checks 0 https://github.com/python/cpython/pull/104267/checks
Files changed https://github.com/python/cpython/pull/104267/files
Please reload this pagehttps://github.com/python/cpython/pull/104267
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023https://github.com/python/cpython/pull/104267#issue-1699101338
Please reload this pagehttps://github.com/python/cpython/pull/104267
@sobolevnhttps://github.com/sobolevn
#103193 (comment)https://github.com/python/cpython/issues/103193#issuecomment-1497396338
@carljmhttps://github.com/carljm
Optimise inspect.getattr_static #103193https://github.com/python/cpython/issues/103193
Please reload this pagehttps://github.com/python/cpython/pull/104267
https://github.com/AlexWaygood
pythongh-103193https://github.com/python/cpython/issues/103193
: cache calls to inspect._shadowed_dicthttps://github.com/python/cpython/pull/104267/commits/cb580bac935c111727ce177ae9b56109c5fce4b3
cb580bahttps://github.com/python/cpython/pull/104267/commits/cb580bac935c111727ce177ae9b56109c5fce4b3
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
May 7, 2023https://github.com/python/cpython/pull/104267#event-9184445890
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
May 7, 2023 https://github.com/python/cpython/pull/104267#ref-issue-1651011100
Optimise inspect.getattr_static #103193 https://github.com/python/cpython/issues/103193
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
carljmhttps://github.com/carljm
May 7, 2023 14:59https://github.com/python/cpython/pull/104267#event-9184446113
https://github.com/carljm
carljmhttps://github.com/carljm
May 7, 2023https://github.com/python/cpython/pull/104267#issuecomment-1537463897
Please reload this pagehttps://github.com/python/cpython/pull/104267
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023https://github.com/python/cpython/pull/104267#issuecomment-1537464615
Please reload this pagehttps://github.com/python/cpython/pull/104267
Please reload this pagehttps://github.com/python/cpython/pull/104267
https://github.com/carljm
carljmhttps://github.com/carljm
May 7, 2023https://github.com/python/cpython/pull/104267#issuecomment-1537466094
Please reload this pagehttps://github.com/python/cpython/pull/104267
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023https://github.com/python/cpython/pull/104267#issuecomment-1537466743
Please reload this pagehttps://github.com/python/cpython/pull/104267
Please reload this pagehttps://github.com/python/cpython/pull/104267
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023https://github.com/python/cpython/pull/104267#issuecomment-1537469424
Please reload this pagehttps://github.com/python/cpython/pull/104267
https://github.com/AlexWaygood
Use mro tuple as the cache keyhttps://github.com/python/cpython/pull/104267/commits/c26587c462935935eb68172dc179d1d9298e3864
c26587chttps://github.com/python/cpython/pull/104267/commits/c26587c462935935eb68172dc179d1d9298e3864
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023 https://github.com/python/cpython/pull/104267#pullrequestreview-1415928452
View reviewed changes https://github.com/python/cpython/pull/104267/files/c26587c462935935eb68172dc179d1d9298e3864
Lib/inspect.pyhttps://github.com/python/cpython/pull/104267/files/c26587c462935935eb68172dc179d1d9298e3864#diff-b89cd06e4637abacb73f2500301ff979a67ad7ecbfa7cf151c7243715898d7ea
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023https://github.com/python/cpython/pull/104267#discussion_r1186873998
Please reload this pagehttps://github.com/python/cpython/pull/104267
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/104267
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023 16:46https://github.com/python/cpython/pull/104267#commits-pushed-b3cc123
https://github.com/AlexWaygood
Add regression test for if a class has its mro mutated(!)https://github.com/python/cpython/pull/104267/commits/b3cc123ad1ca8d4371a912cdb0d364b962fb016f
b3cc123https://github.com/python/cpython/pull/104267/commits/b3cc123ad1ca8d4371a912cdb0d364b962fb016f
https://github.com/AlexWaygood
Update perf numbers in whatsnewhttps://github.com/python/cpython/pull/104267/commits/2f4b42faaffdc0952ee69158160ccc87a78080a9
2f4b42fhttps://github.com/python/cpython/pull/104267/commits/2f4b42faaffdc0952ee69158160ccc87a78080a9
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
skip news https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22skip%20news%22
May 7, 2023https://github.com/python/cpython/pull/104267#event-9184572279
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023 16:22https://github.com/python/cpython/pull/104267#event-9184572607
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
May 7, 2023https://github.com/python/cpython/pull/104267#event-9184579285
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023https://github.com/python/cpython/pull/104267#issuecomment-1537485862
Please reload this pagehttps://github.com/python/cpython/pull/104267
Please reload this pagehttps://github.com/python/cpython/pull/104267
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
type-feature https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Atype-feature
stdlib https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Astdlib
3.12 https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A3.12
May 7, 2023https://github.com/python/cpython/pull/104267#event-9184582996
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023https://github.com/python/cpython/pull/104267#issuecomment-1537486380
https://github.com/python/cpython/pull/103195/fileshttps://github.com/python/cpython/pull/103195/files
Please reload this pagehttps://github.com/python/cpython/pull/104267
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023https://github.com/python/cpython/pull/104267#event-9184612582
https://github.com/carljm
carljmhttps://github.com/carljm
May 7, 2023 https://github.com/python/cpython/pull/104267#pullrequestreview-1415940809
View reviewed changes https://github.com/python/cpython/pull/104267/files/2f4b42faaffdc0952ee69158160ccc87a78080a9
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
May 7, 2023https://github.com/python/cpython/pull/104267#event-9184664129
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
1b19bd1https://github.com/python/cpython/commit/1b19bd1a88e6c410fc9cd08db48e0d35cfa8bb5a
May 7, 2023https://github.com/python/cpython/pull/104267#event-9184684242
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
May 7, 2023https://github.com/python/cpython/pull/104267#event-9184684292
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023 17:45https://github.com/python/cpython/pull/104267#event-9184684299
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
May 7, 2023https://github.com/python/cpython/pull/104267#issuecomment-1537502604
@carljmhttps://github.com/carljm
Please reload this pagehttps://github.com/python/cpython/pull/104267
jbower-fbhttps://github.com/jbower-fb
May 8, 2023 https://github.com/python/cpython/pull/104267#ref-commit-86ca8d2
https://github.com/AlexWaygood
https://github.com/carljm
https://github.com/jbower-fb
pythongh-103193https://github.com/python/cpython/issues/103193
: cache calls tohttps://github.com/jbower-fb/cpython/commit/86ca8d242de24f62b1bbcdf4109822d14bcc3ee1
inspect._shadowed_dicthttps://github.com/jbower-fb/cpython/commit/86ca8d242de24f62b1bbcdf4109822d14bcc3ee1
in `inspect.…https://github.com/jbower-fb/cpython/commit/86ca8d242de24f62b1bbcdf4109822d14bcc3ee1
86ca8d2https://github.com/jbower-fb/cpython/commit/86ca8d242de24f62b1bbcdf4109822d14bcc3ee1
python#104267https://github.com/python/cpython/pull/104267
https://github.com/williamwen42
williamwen42https://github.com/williamwen42
Apr 17, 2024 https://github.com/python/cpython/pull/104267#ref-issue-2249342935
[3.12] getattr_static can result in reference leaks #118013 https://github.com/python/cpython/issues/118013
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
Apr 23, 2024 https://github.com/python/cpython/pull/104267#ref-pullrequest-2259924600
gh-118013: Use weakrefs for the cache key in inspect._shadowed_dict #118202 https://github.com/python/cpython/pull/118202
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%2F104267
https://github.com/carljm
carljm https://github.com/carljm
https://github.com/python/cpython/pull/104267/files/2f4b42faaffdc0952ee69158160ccc87a78080a9
3.12 https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A3.12
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
skip news https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22skip%20news%22
stdlib https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Astdlib
type-feature https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Atype-feature
Please reload this pagehttps://github.com/python/cpython/pull/104267
https://github.com/AlexWaygood
https://github.com/carljm
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.