René's URL Explorer Experiment


Title: bpo-31336: Speed up type creation, which is highly dominated by slow dict lookups. by scoder · Pull Request #3279 · python/cpython · GitHub

Open Graph Title: bpo-31336: Speed up type creation, which is highly dominated by slow dict lookups. by scoder · Pull Request #3279 · python/cpython

X Title: bpo-31336: Speed up type creation, which is highly dominated by slow dict lookups. by scoder · Pull Request #3279 · python/cpython

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

Open Graph Description: This gives me around 20% better performance for class Test: pass. Admittedly, that's a micro-benchmark, but the change is obvious enough to not merit staying slow. https://bugs.python.org/issu...

X Description: This gives me around 20% better performance for class Test: pass. Admittedly, that's a micro-benchmark, but the change is obvious enough to not merit staying slow. https://bugs.python.org/...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:56f82cac-cacc-48db-a929-e31793504871
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBF1E:15F81E:1207F6:1A1DC7:6A58A6CF
html-safe-nonce3dd7b7792d71654cb1d93a89beda57d304e8611761859ef73d3c54910befdcb5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjFFOjE1RjgxRToxMjA3RjY6MUExREM3OjZBNThBNkNGIiwidmlzaXRvcl9pZCI6Ijg1NDkxNDIyMzk5NDczMDI2MDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac805dd2f3ac5577169389f82a89a169bc855f091606821a1502bc981469a18122
hovercard-subject-tagpull_request:139139121
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/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/3279/commits
twitter:imagehttps://opengraph.githubassets.com/523616b95c20a5e97e1b18e6af7334c780593099eed08507e1cfb4aad6728bec/python/cpython/pull/3279
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/523616b95c20a5e97e1b18e6af7334c780593099eed08507e1cfb4aad6728bec/python/cpython/pull/3279
og:image:altThis gives me around 20% better performance for class Test: pass. Admittedly, that's a micro-benchmark, but the change is obvious enough to not merit staying slow. https://bugs.python.org/issu...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamescoder
hostnamegithub.com
expected-hostnamegithub.com
None5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6
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
release8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/3279/commits#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F3279%2Fcommits
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2F3279%2Fcommits
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%2Fpull_requests%2Fshow%2Fcommits&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/3279/commits
Reloadhttps://github.com/python/cpython/pull/3279/commits
Reloadhttps://github.com/python/cpython/pull/3279/commits
Please reload this pagehttps://github.com/python/cpython/pull/3279/commits
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/3279/commits
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k 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.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
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 and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
serhiy-storchakahttps://github.com/serhiy-storchaka
python:masterhttps://github.com/python/cpython/tree/master
scoder:_fast_pytype_lookuphttps://github.com/scoder/cpython/tree/_fast_pytype_lookup
Conversationhttps://github.com/python/cpython/pull/3279
Commits20 (20)https://github.com/python/cpython/pull/3279/commits
Checkshttps://github.com/python/cpython/pull/3279/checks
Files changedhttps://github.com/python/cpython/pull/3279/files
bpo-31336: Speed up type creation, which is highly dominated by slow dict lookups.https://github.com/python/cpython/pull/3279/commits#top
serhiy-storchakahttps://github.com/serhiy-storchaka
python:masterhttps://github.com/python/cpython/tree/master
scoder:_fast_pytype_lookuphttps://github.com/scoder/cpython/tree/_fast_pytype_lookup
Speed up type creation, which is highly dominated by slow dict lookups.https://github.com/python/cpython/pull/3279/commits/0a865c9309c6548fe6380500f02240d1995d3b16
0a865c9https://github.com/python/cpython/pull/3279/commits/0a865c9309c6548fe6380500f02240d1995d3b16
https://github.com/python/cpython/tree/0a865c9309c6548fe6380500f02240d1995d3b16
Update comment after changing the function call that it refers to.https://github.com/python/cpython/pull/3279/commits/c4779e3f7c06d1e53386f18e6bad3b045741369d
c4779e3https://github.com/python/cpython/pull/3279/commits/c4779e3f7c06d1e53386f18e6bad3b045741369d
https://github.com/python/cpython/tree/c4779e3f7c06d1e53386f18e6bad3b045741369d
Ignore any errors (however unlikely) that may happen during the mro chained name lookups in _PyType_Lookup().https://github.com/python/cpython/pull/3279/commits/ff2ea631ebc3b64f8785cfdbaa922cd3546bd1b1
ff2ea63https://github.com/python/cpython/pull/3279/commits/ff2ea631ebc3b64f8785cfdbaa922cd3546bd1b1
https://github.com/python/cpython/tree/ff2ea631ebc3b64f8785cfdbaa922cd3546bd1b1
Extract non-caching code from _PyType_Lookup() to use it directly from update_one_slot().https://github.com/python/cpython/pull/3279/commits/76b1986e093e9b236106df3abb7dfcd6f60e43ad
76b1986https://github.com/python/cpython/pull/3279/commits/76b1986e093e9b236106df3abb7dfcd6f60e43ad
https://github.com/python/cpython/tree/76b1986e093e9b236106df3abb7dfcd6f60e43ad
Avoid some useless overhead for the no-basetype case. If "object" ever ceases to be a valid base type, there'll probably be larger code sections to change than this one.https://github.com/python/cpython/pull/3279/commits/6f9848520ca858ae72d14ee99d0d86796b664981
6f98485https://github.com/python/cpython/pull/3279/commits/6f9848520ca858ae72d14ee99d0d86796b664981
https://github.com/python/cpython/tree/6f9848520ca858ae72d14ee99d0d86796b664981
Add comment.https://github.com/python/cpython/pull/3279/commits/d9b726e6ddaae31b01b41c33572e4f6f3fa1a63b
d9b726ehttps://github.com/python/cpython/pull/3279/commits/d9b726e6ddaae31b01b41c33572e4f6f3fa1a63b
https://github.com/python/cpython/tree/d9b726e6ddaae31b01b41c33572e4f6f3fa1a63b
Avoid uselessly searching empty bases for a metaclass. This is quite common in Python 3 now.https://github.com/python/cpython/pull/3279/commits/be15255ff763ce1018a7318590dc37a4c1e04a00
be15255https://github.com/python/cpython/pull/3279/commits/be15255ff763ce1018a7318590dc37a4c1e04a00
https://github.com/python/cpython/tree/be15255ff763ce1018a7318590dc37a4c1e04a00
Avoid unsafe handling of borrowed "mro" reference during hash() call.https://github.com/python/cpython/pull/3279/commits/0736226d67b43c70013a397be7157a7317b42057
0736226https://github.com/python/cpython/pull/3279/commits/0736226d67b43c70013a397be7157a7317b42057
https://github.com/python/cpython/tree/0736226d67b43c70013a397be7157a7317b42057
Clean up code and formatting a little.https://github.com/python/cpython/pull/3279/commits/8bc783f07e60c39afa464029b8d58443a0140137
8bc783fhttps://github.com/python/cpython/pull/3279/commits/8bc783f07e60c39afa464029b8d58443a0140137
https://github.com/python/cpython/tree/8bc783f07e60c39afa464029b8d58443a0140137
Add braces for code style reasons.https://github.com/python/cpython/pull/3279/commits/66648dd568cfefdf1f003bce8fc2aced4ec6972b
66648ddhttps://github.com/python/cpython/pull/3279/commits/66648dd568cfefdf1f003bce8fc2aced4ec6972b
https://github.com/python/cpython/tree/66648dd568cfefdf1f003bce8fc2aced4ec6972b
Give internal helper function a local name that does not resemble (existing) API names.https://github.com/python/cpython/pull/3279/commits/85fb3aedd4a878cbd18145c92b32a03c7fdcbfeb
85fb3aehttps://github.com/python/cpython/pull/3279/commits/85fb3aedd4a878cbd18145c92b32a03c7fdcbfeb
https://github.com/python/cpython/tree/85fb3aedd4a878cbd18145c92b32a03c7fdcbfeb
Allow non-dict types for the class dict when looking up names and call PyObject_GetItem() for them.https://github.com/python/cpython/pull/3279/commits/09e716a2e8eda777400da779c5a4f1b5e90375f6
09e716ahttps://github.com/python/cpython/pull/3279/commits/09e716a2e8eda777400da779c5a4f1b5e90375f6
https://github.com/python/cpython/tree/09e716a2e8eda777400da779c5a4f1b5e90375f6
Lazily calculate name hash in find_name_in_mro() to avoid potential re-calculation if the mapping is not exactly a dict.https://github.com/python/cpython/pull/3279/commits/1d52082bb544de02901f922242942253497cba58
1d52082https://github.com/python/cpython/pull/3279/commits/1d52082bb544de02901f922242942253497cba58
https://github.com/python/cpython/tree/1d52082bb544de02901f922242942253497cba58
Revert "Lazily calculate name hash in find_name_in_mro() to avoid potential re-calculation if the mapping is not exactly a dict."https://github.com/python/cpython/pull/3279/commits/f09bfd3fe764ae5cfb18c2a8b334964c76566c91
f09bfd3https://github.com/python/cpython/pull/3279/commits/f09bfd3fe764ae5cfb18c2a8b334964c76566c91
https://github.com/python/cpython/tree/f09bfd3fe764ae5cfb18c2a8b334964c76566c91
Revert "Allow non-dict types for the class dict when looking up names and call PyObject_GetItem() for them."https://github.com/python/cpython/pull/3279/commits/824d7cb25cd25368e9d04c5be5f75c8c790d8447
824d7cbhttps://github.com/python/cpython/pull/3279/commits/824d7cb25cd25368e9d04c5be5f75c8c790d8447
https://github.com/python/cpython/tree/824d7cb25cd25368e9d04c5be5f75c8c790d8447
add news entry for faster class creationhttps://github.com/python/cpython/pull/3279/commits/51841915d6f5f87c7f3559c7c83d0b2ce8ffebff
5184191https://github.com/python/cpython/pull/3279/commits/51841915d6f5f87c7f3559c7c83d0b2ce8ffebff
https://github.com/python/cpython/tree/51841915d6f5f87c7f3559c7c83d0b2ce8ffebff
Change nice interface of "find_name_in_mro()" to evil interface eating lookup exceptions, just like "_PyType_Lookup()" did previously.https://github.com/python/cpython/pull/3279/commits/4efde8ea72195e987a7946985b22725b1d8f4e3a
4efde8ehttps://github.com/python/cpython/pull/3279/commits/4efde8ea72195e987a7946985b22725b1d8f4e3a
https://github.com/python/cpython/tree/4efde8ea72195e987a7946985b22725b1d8f4e3a
Mention amount of speedup in News entry.https://github.com/python/cpython/pull/3279/commits/f5bce2a5494ee5856677d6345a55254e6cff2607
f5bce2ahttps://github.com/python/cpython/pull/3279/commits/f5bce2a5494ee5856677d6345a55254e6cff2607
https://github.com/python/cpython/tree/f5bce2a5494ee5856677d6345a55254e6cff2607
Revert "Change nice interface of "find_name_in_mro()" to evil interface eating lookup exceptions, just like "_PyType_Lookup()" did previously."https://github.com/python/cpython/pull/3279/commits/02bfef0f8dbe7b51e6f3c231c0d3d7a2554687ca
02bfef0https://github.com/python/cpython/pull/3279/commits/02bfef0f8dbe7b51e6f3c231c0d3d7a2554687ca
https://github.com/python/cpython/tree/02bfef0f8dbe7b51e6f3c231c0d3d7a2554687ca
Guard against external live exceptions when calling find_name_in_mro() from functions that swallow live exceptions.https://github.com/python/cpython/pull/3279/commits/24978587ccaebb90ac858c6285b6d793a47ed969
2497858https://github.com/python/cpython/pull/3279/commits/24978587ccaebb90ac858c6285b6d793a47ed969
https://github.com/python/cpython/tree/24978587ccaebb90ac858c6285b6d793a47ed969
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.