René's URL Explorer Experiment


Title: gh-74690: Further optimise `typing._ProtocolMeta.__instancecheck__` by AlexWaygood · Pull Request #103280 · python/cpython · GitHub

Open Graph Title: gh-74690: Further optimise `typing._ProtocolMeta.__instancecheck__` by AlexWaygood · Pull Request #103280 · python/cpython

X Title: gh-74690: Further optimise `typing._ProtocolMeta.__instancecheck__` by AlexWaygood · Pull Request #103280 · python/cpython

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

Open Graph Description: I probably should have spotted this when doing #103034! This provides some more speedup for isinstance() checks against runtime-checkable protocols. The improvement is small, but noticeable. Benchm...

X Description: I probably should have spotted this when doing #103034! This provides some more speedup for isinstance() checks against runtime-checkable protocols. The improvement is small, but noticeable. Benchm...

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

X: @github

direct link

Domain: togithub.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/_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:4bdd1d2c-729a-018b-7cf6-ef23d9e2a798
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC3DE:3D7D23:D7BDE:12731F:6AFE33A9
html-safe-nonceffa33366aafabfedc9627beb2715a20f397317bee2aae18538d851f1c8c93ddc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0RFOjNEN0QyMzpEN0JERToxMjczMUY6NkFGRTMzQTkiLCJ2aXNpdG9yX2lkIjoiMjIzNDc3ODgzNDMxNjQ0MDQ4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacdbc16859c0b94da9c95c48cbe15cf5422d38a306ca8d768307c9dfe6d32801ee
hovercard-subject-tagpull_request:1303358185
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/103280/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/0a13844745acc064d3634b92c3f2f418d7b5303b6e2ff68125d33829c68d93bf/python/cpython/pull/103280
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0a13844745acc064d3634b92c3f2f418d7b5303b6e2ff68125d33829c68d93bf/python/cpython/pull/103280
og:image:altI probably should have spotted this when doing #103034! This provides some more speedup for isinstance() checks against runtime-checkable protocols. The improvement is small, but noticeable. Benchm...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAlexWaygood
hostnamegithub.com
expected-hostnamegithub.com
Noned70e31220a67f6376c108d2416fa8e7df854c1065b1672ab7a88ab6dc3a809e2
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
releaseccb88d9c92abe69245b429398c8a57ae87070c7c
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://togithub.com/python/cpython/pull/103280#start-of-content
https://togithub.com/
Sign inhttps://togithub.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F103280
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://togithub.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F103280
Sign uphttps://togithub.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://togithub.com/python/cpython/pull/103280
Reloadhttps://togithub.com/python/cpython/pull/103280
Reloadhttps://togithub.com/python/cpython/pull/103280
pythonhttps://togithub.com/python
cpythonhttps://togithub.com/python/cpython
Codehttps://togithub.com/python/cpython
Issues5k+ (5k+)https://togithub.com/python/cpython/issues
Pull requests2.4k (2.4k)https://togithub.com/python/cpython/pulls
Actionshttps://togithub.com/python/cpython/actions
Projectshttps://togithub.com/python/cpython/projects
Security and qualityhttps://togithub.com/python/cpython/security
Insightshttps://togithub.com/python/cpython/insights
https://togithub.com/python/cpython
AlexWaygoodhttps://togithub.com/AlexWaygood
python:mainhttps://togithub.com/python/cpython/tree/main
AlexWaygood:more-optimisationhttps://togithub.com/AlexWaygood/cpython/tree/more-optimisation
Conversationhttps://togithub.com/python/cpython/pull/103280
Commits1 (1)https://togithub.com/python/cpython/pull/103280/commits
Checkshttps://togithub.com/python/cpython/pull/103280/checks
Files changedhttps://togithub.com/python/cpython/pull/103280/files
gh-74690: Further optimise typing._ProtocolMeta.__instancecheck__https://togithub.com/python/cpython/pull/103280#top
AlexWaygoodhttps://togithub.com/AlexWaygood
python:mainhttps://togithub.com/python/cpython/tree/main
AlexWaygood:more-optimisationhttps://togithub.com/AlexWaygood/cpython/tree/more-optimisation
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
Apr 5, 2023https://togithub.com/python/cpython/pull/103280#issue-1655797096
Please reload this pagehttps://togithub.com/python/cpython/pull/103280
#103034https://github.com/python/cpython/pull/103034
Performance of typing._ProtocolMeta._get_protocol_attrs and isinstance #74690https://github.com/python/cpython/issues/74690
Please reload this pagehttps://togithub.com/python/cpython/pull/103280
https://togithub.com/AlexWaygood
pythongh-74690https://github.com/python/cpython/issues/74690
: Further optimise `typing._ProtocolMeta.__instancechec…https://togithub.com/python/cpython/pull/103280/commits/eee4b2c91c1da374f9d5b2cb735d96f7bef4c3dc
eee4b2chttps://togithub.com/python/cpython/pull/103280/commits/eee4b2c91c1da374f9d5b2cb735d96f7bef4c3dc
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
type-feature https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3Atype-feature
performance https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
stdlib https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3Astdlib
topic-typing https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3Atopic-typing
3.12 https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3A3.12
Apr 5, 2023https://togithub.com/python/cpython/pull/103280#event-8936274410
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
carljmhttps://togithub.com/carljm
April 5, 2023 15:00https://togithub.com/python/cpython/pull/103280#event-8936274484
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
Fidget-Spinnerhttps://togithub.com/Fidget-Spinner
JelleZijlstrahttps://togithub.com/JelleZijlstra
gvanrossumhttps://togithub.com/gvanrossum
code ownershttps://togithub.com/python/cpython/blob/fdd0fff277a55c010a4da0a7af0e986e38560545/.github/CODEOWNERS#L141
April 5, 2023 15:00https://togithub.com/python/cpython/pull/103280#event-8936274650
https://togithub.com/bedevere-bot
bedevere-bothttps://togithub.com/bedevere-bot
awaiting core review https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Apr 5, 2023https://togithub.com/python/cpython/pull/103280#event-8936275183
https://togithub.com/bedevere-bot
bedevere-bothttps://togithub.com/bedevere-bot
Apr 5, 2023 https://togithub.com/python/cpython/pull/103280#ref-issue-1198974045
Performance of typing._ProtocolMeta._get_protocol_attrs and isinstance #74690 https://togithub.com/python/cpython/issues/74690
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
skip news https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3A%22skip%20news%22
Apr 5, 2023https://togithub.com/python/cpython/pull/103280#event-8936282169
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
Apr 5, 2023https://togithub.com/python/cpython/pull/103280#issuecomment-1497642821
Please reload this pagehttps://togithub.com/python/cpython/pull/103280
#74690 (comment)https://github.com/python/cpython/issues/74690#issuecomment-1497351414
Please reload this pagehttps://togithub.com/python/cpython/pull/103280
https://togithub.com/carljm
carljmhttps://togithub.com/carljm
Apr 5, 2023 https://togithub.com/python/cpython/pull/103280#pullrequestreview-1373298339
View reviewed changes https://togithub.com/python/cpython/pull/103280/files/eee4b2c91c1da374f9d5b2cb735d96f7bef4c3dc
https://togithub.com/bedevere-bot
bedevere-bothttps://togithub.com/bedevere-bot
awaiting merge https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
awaiting core review https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Apr 5, 2023https://togithub.com/python/cpython/pull/103280#event-8937251900
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
de18267https://togithub.com/python/cpython/commit/de182676853e8de22363e8a0641c42392c0fdaa9
Apr 5, 2023https://github.com/python/cpython/pull/103280#event-8937273148
https://togithub.com/bedevere-bot
bedevere-bothttps://togithub.com/bedevere-bot
awaiting merge https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
Apr 5, 2023https://togithub.com/python/cpython/pull/103280#event-8937273606
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
April 5, 2023 16:37https://togithub.com/python/cpython/pull/103280#event-8937273790
https://togithub.com/bedevere-bot
Sign in to viewhttps://togithub.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F103280
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
Apr 7, 2023 https://togithub.com/python/cpython/pull/103280#ref-pullrequest-1658857896
gh-74690: Document changes made to runtime-checkable protocols in 3.12 #103348 https://togithub.com/python/cpython/pull/103348
gaogaotiantianhttps://togithub.com/gaogaotiantian
Apr 8, 2023 https://togithub.com/python/cpython/pull/103280#ref-commit-d515fb0
https://togithub.com/AlexWaygood
https://togithub.com/gaogaotiantian
pythongh-74690https://github.com/python/cpython/issues/74690
: Further optimise `typing._ProtocolMeta.__instancechec…https://togithub.com/gaogaotiantian/cpython/commit/d515fb0d7088e3f2fee086732b98955a8fdb804f
d515fb0https://togithub.com/gaogaotiantian/cpython/commit/d515fb0d7088e3f2fee086732b98955a8fdb804f
python#103280https://github.com/python/cpython/pull/103280
warsawhttps://togithub.com/warsaw
Apr 11, 2023 https://togithub.com/python/cpython/pull/103280#ref-commit-d9edf14
https://togithub.com/AlexWaygood
https://togithub.com/warsaw
pythongh-74690https://github.com/python/cpython/issues/74690
: Further optimise `typing._ProtocolMeta.__instancechec…https://togithub.com/warsaw/cpython/commit/d9edf14b6b513015b654f893f67dea1223fa3c90
d9edf14https://togithub.com/warsaw/cpython/commit/d9edf14b6b513015b654f893f67dea1223fa3c90
python#103280https://github.com/python/cpython/pull/103280
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
Apr 12, 2023 https://togithub.com/python/cpython/pull/103280#ref-pullrequest-1664378642
Backport performance improvements to runtime-checkable protocols python/typing_extensions#137 https://togithub.com/python/typing_extensions/pull/137
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
May 24, 2023 https://togithub.com/python/cpython/pull/103280#ref-issue-1723200108
[Bug] typing_extensions.Protocol unsupported under typing_extensions ≥ 4.6.0 beartype/beartype#241 https://togithub.com/beartype/beartype/issues/241
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
Aug 9, 2024 https://togithub.com/python/cpython/pull/103280#ref-issue-2410113881
Is the protocol caching still needed? beartype/numerary#20 https://togithub.com/beartype/numerary/issues/20
https://github.co/hiddenchars
https://togithub.com/python/cpython/pull/{{ revealButtonHref }}
Sign up for freehttps://togithub.com/join?source=comment-repo
Sign in to commenthttps://togithub.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F103280
https://togithub.com/carljm
carljm https://togithub.com/carljm
https://togithub.com/python/cpython/pull/103280/files/eee4b2c91c1da374f9d5b2cb735d96f7bef4c3dc
https://togithub.com/gvanrossum
gvanrossum https://togithub.com/gvanrossum
https://togithub.com/Fidget-Spinner
Fidget-Spinner https://togithub.com/Fidget-Spinner
https://togithub.com/JelleZijlstra
JelleZijlstra https://togithub.com/JelleZijlstra
Please reload this pagehttps://togithub.com/python/cpython/pull/103280
3.12 https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3A3.12
performance https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
skip news https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3A%22skip%20news%22
stdlib https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3Astdlib
topic-typing https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3Atopic-typing
type-feature https://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3Atype-feature
Please reload this pagehttps://togithub.com/python/cpython/pull/103280
https://togithub.com/AlexWaygood
https://togithub.com/bedevere-bot
https://togithub.com/carljm
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.