René's URL Explorer Experiment


Title: [mypyc] Speed up ord(str[n]) by inlining by JukkaL · Pull Request #20578 · python/mypy · GitHub

Open Graph Title: [mypyc] Speed up ord(str[n]) by inlining by JukkaL · Pull Request #20578 · python/mypy

X Title: [mypyc] Speed up ord(str[n]) by inlining by JukkaL · Pull Request #20578 · python/mypy

Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.

Open Graph Description: The approach is similar to #20552, which added a fast inlined implementation of bytes get item. However, we do it for ord(str[n]) instead of just str[n], since the latter produces a reference-count...

X Description: The approach is similar to #20552, which added a fast inlined implementation of bytes get item. However, we do it for ord(str[n]) instead of just str[n], since the latter produces a reference-count...

Opengraph URL: https://github.com/python/mypy/pull/20578

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/_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:2f0978a4-bf71-dcba-0e0c-c3c453050e2e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9CFA:3F7946:1FFF945:2B855D9:6B001F05
html-safe-nonce9d80cc5678e6a161d5cb87eda63fc84ebe13b319507a45869437a0c44ee0cb0b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0ZBOjNGNzk0NjoxRkZGOTQ1OjJCODU1RDk6NkIwMDFGMDUiLCJ2aXNpdG9yX2lkIjoiODI1NTQ3MjU4ODM3Mzg5Mjg2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2f6557f51d8d9001ed33f1181b8476294d1528b8226fb06ad0ac5f6ba608f02e
hovercard-subject-tagpull_request:3170459022
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/mypy/20578/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/920e229b89b22c8b1da4c03347a072502359d009095645e1a31df3e9693c4ae1/python/mypy/pull/20578
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/920e229b89b22c8b1da4c03347a072502359d009095645e1a31df3e9693c4ae1/python/mypy/pull/20578
og:image:altThe approach is similar to #20552, which added a fast inlined implementation of bytes get item. However, we do it for ord(str[n]) instead of just str[n], since the latter produces a reference-count...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJukkaL
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
turbo-cache-controlno-cache
go-importgithub.com/python/mypy git https://github.com/python/mypy.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id7053637
octolytics-dimension-repository_nwopython/mypy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7053637
octolytics-dimension-repository_network_root_nwopython/mypy
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
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/mypy/pull/20578#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20578
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%2Fmypy%2Fpull%2F20578
Sign uphttps://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%2Fmypy
Reloadhttps://github.com/python/mypy/pull/20578
Reloadhttps://github.com/python/mypy/pull/20578
Reloadhttps://github.com/python/mypy/pull/20578
pythonhttps://github.com/python
mypyhttps://github.com/python/mypy
Codehttps://github.com/python/mypy
Issues2.7k (2.7k)https://github.com/python/mypy/issues
Pull requests546 (546)https://github.com/python/mypy/pulls
Actionshttps://github.com/python/mypy/actions
Projectshttps://github.com/python/mypy/projects
Wikihttps://github.com/python/mypy/wiki
Security and qualityhttps://github.com/python/mypy/security
Insightshttps://github.com/python/mypy/insights
https://github.com/python/mypy
JukkaLhttps://github.com/JukkaL
masterhttps://github.com/python/mypy/tree/master
mypyc-ord-strhttps://github.com/python/mypy/tree/mypyc-ord-str
Conversationhttps://github.com/python/mypy/pull/20578
Commits10 (10)https://github.com/python/mypy/pull/20578/commits
Checkshttps://github.com/python/mypy/pull/20578/checks
Files changedhttps://github.com/python/mypy/pull/20578/files
[mypyc] Speed up ord(str[n]) by inlininghttps://github.com/python/mypy/pull/20578#top
JukkaLhttps://github.com/JukkaL
masterhttps://github.com/python/mypy/tree/master
mypyc-ord-strhttps://github.com/python/mypy/tree/mypyc-ord-str
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
Jan 13, 2026https://github.com/python/mypy/pull/20578#issue-3809678843
#20552https://github.com/python/mypy/pull/20552
Please reload this pagehttps://github.com/python/mypy/pull/20578
JukkaLhttps://github.com/JukkaL
January 13, 2026 11:25https://github.com/python/mypy/pull/20578#commits-pushed-9e75d86
https://github.com/JukkaL
WIP faster ord(str[i])https://github.com/python/mypy/pull/20578/commits/9e75d865475fbbe2c929a14f72a94f19a46dca10
9e75d86https://github.com/python/mypy/pull/20578/commits/9e75d865475fbbe2c929a14f72a94f19a46dca10
https://github.com/JukkaL
Add inline specialized ops for ord(str[i])https://github.com/python/mypy/pull/20578/commits/5e0ff86b60aea278cc5c6a4c6466c6b2e53ebed6
5e0ff86https://github.com/python/mypy/pull/20578/commits/5e0ff86b60aea278cc5c6a4c6466c6b2e53ebed6
https://github.com/JukkaL
Documenthttps://github.com/python/mypy/pull/20578/commits/421ef634d2375f3aebee7e99591cbd25cfbcfe45
421ef63https://github.com/python/mypy/pull/20578/commits/421ef634d2375f3aebee7e99591cbd25cfbcfe45
https://github.com/JukkaL
Minor refactoringhttps://github.com/python/mypy/pull/20578/commits/d3ef016d824aabf6f5e67b5d7901bb6b455dcb18
d3ef016https://github.com/python/mypy/pull/20578/commits/d3ef016d824aabf6f5e67b5d7901bb6b455dcb18
https://github.com/JukkaL
These aren't experimentalhttps://github.com/python/mypy/pull/20578/commits/058f3140bc9117608468893251e9912b7b45a98e
058f314https://github.com/python/mypy/pull/20578/commits/058f3140bc9117608468893251e9912b7b45a98e
https://github.com/JukkaL
Fix testhttps://github.com/python/mypy/pull/20578/commits/107ada94a3473ff7c98f1d546a2fee3c3a6016b8
107ada9https://github.com/python/mypy/pull/20578/commits/107ada94a3473ff7c98f1d546a2fee3c3a6016b8
https://github.com/JukkaL
Update dochttps://github.com/python/mypy/pull/20578/commits/8708e5bbba209d345baa713ca6215ad379b0ed3c
8708e5bhttps://github.com/python/mypy/pull/20578/commits/8708e5bbba209d345baa713ca6215ad379b0ed3c
https://github.com/JukkaL
Use more specific return typehttps://github.com/python/mypy/pull/20578/commits/e6ad7337ad7c9c8bef3bfca90577fa54f93788c6
e6ad733https://github.com/python/mypy/pull/20578/commits/e6ad7337ad7c9c8bef3bfca90577fa54f93788c6
https://github.com/JukkaL
Add run testshttps://github.com/python/mypy/pull/20578/commits/c9a845f4c1ade367f924c7dd4f1689ac2d1a1765
c9a845fhttps://github.com/python/mypy/pull/20578/commits/c9a845f4c1ade367f924c7dd4f1689ac2d1a1765
https://github.com/JukkaL
Only run test on 64-bit platformshttps://github.com/python/mypy/pull/20578/commits/dcd47d40c0f83bc9194e75c167871d27ca60a193
dcd47d4https://github.com/python/mypy/pull/20578/commits/dcd47d40c0f83bc9194e75c167871d27ca60a193
https://github.com/p-sawicki
p-sawickihttps://github.com/p-sawicki
Jan 13, 2026 https://github.com/python/mypy/pull/20578#pullrequestreview-3656921843
View reviewed changes https://github.com/python/mypy/pull/20578/files/dcd47d40c0f83bc9194e75c167871d27ca60a193
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
59257a2https://github.com/python/mypy/commit/59257a28e9b42076b619ae5f2c699d446c875682
Jan 13, 2026https://github.com/python/mypy/pull/20578#event-22023363534
Please reload this pagehttps://github.com/python/mypy/pull/20578
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
January 13, 2026 17:44https://github.com/python/mypy/pull/20578#event-22023364178
michaelm-openaihttps://github.com/michaelm-openai
Jan 16, 2026 https://github.com/python/mypy/pull/20578#ref-commit-846b7f0
https://github.com/JukkaL
https://github.com/michaelm-openai
[mypyc] Speed up ord(str[n]) by inlining (https://github.com/michaelm-openai/mypy/commit/846b7f0960844c62ea71adfbd46f89215df8e1a0
python#20578https://github.com/python/mypy/pull/20578
)https://github.com/michaelm-openai/mypy/commit/846b7f0960844c62ea71adfbd46f89215df8e1a0
846b7f0https://github.com/michaelm-openai/mypy/commit/846b7f0960844c62ea71adfbd46f89215df8e1a0
python#20552https://github.com/python/mypy/pull/20552
michaelm-openaihttps://github.com/michaelm-openai
Jan 16, 2026 https://github.com/python/mypy/pull/20578#ref-commit-e4b1b96
https://github.com/JukkaL
https://github.com/michaelm-openai
[mypyc] Speed up ord(str[n]) by inlining (https://github.com/michaelm-openai/mypy/commit/e4b1b96cf26d91754275a328d1aedb95dbc4c866
python#20578https://github.com/python/mypy/pull/20578
)https://github.com/michaelm-openai/mypy/commit/e4b1b96cf26d91754275a328d1aedb95dbc4c866
e4b1b96https://github.com/michaelm-openai/mypy/commit/e4b1b96cf26d91754275a328d1aedb95dbc4c866
python#20552https://github.com/python/mypy/pull/20552
VaggelisDhttps://github.com/VaggelisD
May 11, 2026 https://github.com/python/mypy/pull/20578#ref-commit-f189057
https://github.com/VaggelisD
[mypyc] Add librt.strings.isspace codepoint primitivehttps://github.com/VaggelisD/sqlglot-mypy/commit/f189057cae1727da2d443deedd010f841f8afa1d
f189057https://github.com/VaggelisD/sqlglot-mypy/commit/f189057cae1727da2d443deedd010f841f8afa1d
python#20578https://github.com/python/mypy/pull/20578
VaggelisDhttps://github.com/VaggelisD
May 11, 2026 https://github.com/python/mypy/pull/20578#ref-commit-b1cd1fd
https://github.com/VaggelisD
[mypyc] Add librt.strings.isspace codepoint primitivehttps://github.com/VaggelisD/sqlglot-mypy/commit/b1cd1fdc1a1cca0474d9c510d777c71b97645add
b1cd1fdhttps://github.com/VaggelisD/sqlglot-mypy/commit/b1cd1fdc1a1cca0474d9c510d777c71b97645add
python#20578https://github.com/python/mypy/pull/20578
VaggelisDhttps://github.com/VaggelisD
May 11, 2026 https://github.com/python/mypy/pull/20578#ref-commit-8b0557a
https://github.com/VaggelisD
[mypyc] Add librt.strings.isspace codepoint primitivehttps://github.com/VaggelisD/sqlglot-mypy/commit/8b0557ab495908cbae7a3e280945318966d4d12d
8b0557ahttps://github.com/VaggelisD/sqlglot-mypy/commit/8b0557ab495908cbae7a3e280945318966d4d12d
python#20578https://github.com/python/mypy/pull/20578
VaggelisDhttps://github.com/VaggelisD
Jun 2, 2026 https://github.com/python/mypy/pull/20578#ref-commit-9df622f
https://github.com/VaggelisD
[mypyc] Specialize s[i] == 'x' to a codepoint int comparehttps://github.com/VaggelisD/sqlglot-mypy/commit/9df622fa0987ce0afd93ad19c0386f014302ecb1
9df622fhttps://github.com/VaggelisD/sqlglot-mypy/commit/9df622fa0987ce0afd93ad19c0386f014302ecb1
python#20578https://github.com/python/mypy/pull/20578
python#21462https://github.com/python/mypy/pull/21462
python#21504https://github.com/python/mypy/pull/21504
python#21509https://github.com/python/mypy/pull/21509
python#21521https://github.com/python/mypy/pull/21521
python#21522https://github.com/python/mypy/pull/21522
python#21553https://github.com/python/mypy/pull/21553
VaggelisDhttps://github.com/VaggelisD
Jun 2, 2026 https://github.com/python/mypy/pull/20578#ref-commit-60abe82
https://github.com/VaggelisD
[mypyc] Specialize s[i] == 'x' to a codepoint int comparehttps://github.com/VaggelisD/sqlglot-mypy/commit/60abe8210a485e68577666ba6ba8661bc4b10ded
60abe82https://github.com/VaggelisD/sqlglot-mypy/commit/60abe8210a485e68577666ba6ba8661bc4b10ded
python#20578https://github.com/python/mypy/pull/20578
python#21462https://github.com/python/mypy/pull/21462
python#21504https://github.com/python/mypy/pull/21504
python#21509https://github.com/python/mypy/pull/21509
python#21521https://github.com/python/mypy/pull/21521
python#21522https://github.com/python/mypy/pull/21522
python#21553https://github.com/python/mypy/pull/21553
VaggelisDhttps://github.com/VaggelisD
Jun 4, 2026 https://github.com/python/mypy/pull/20578#ref-commit-e116c95
https://github.com/VaggelisD
[mypyc] Specialize s[i] == 'x' to a codepoint int comparehttps://github.com/VaggelisD/sqlglot-mypy/commit/e116c953597b8c7726faf9fc2b6813c907474630
e116c95https://github.com/VaggelisD/sqlglot-mypy/commit/e116c953597b8c7726faf9fc2b6813c907474630
python#20578https://github.com/python/mypy/pull/20578
python#21462https://github.com/python/mypy/pull/21462
python#21504https://github.com/python/mypy/pull/21504
python#21509https://github.com/python/mypy/pull/21509
python#21521https://github.com/python/mypy/pull/21521
python#21522https://github.com/python/mypy/pull/21522
python#21553https://github.com/python/mypy/pull/21553
https://github.co/hiddenchars
https://github.com/python/mypy/pull/{{ revealButtonHref }}
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%2Fmypy%2Fpull%2F20578
https://github.com/p-sawicki
p-sawicki https://github.com/p-sawicki
https://github.com/python/mypy/pull/20578/files/dcd47d40c0f83bc9194e75c167871d27ca60a193
Please reload this pagehttps://github.com/python/mypy/pull/20578
Please reload this pagehttps://github.com/python/mypy/pull/20578
https://github.com/JukkaL
https://github.com/p-sawicki
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.