René's URL Explorer Experiment


Title: gh-143658: importlib.metadata: Use `str.translate` to improve performance of `importlib.metadata.Prepared.normalized` by hugovk · Pull Request #143660 · python/cpython · GitHub

Open Graph Title: gh-143658: importlib.metadata: Use `str.translate` to improve performance of `importlib.metadata.Prepared.normalized` by hugovk · Pull Request #143660 · python/cpython

X Title: gh-143658: importlib.metadata: Use `str.translate` to improve performance of `importlib.metadata.Prepared.normalized` by hugovk · Pull Request #143660 · python/cpython

Description: We can apply @henryiii's improvement to packaging in pypa/packaging#1030 (see also https://iscinumpy.dev/post/packaging-faster/) to improve the performance of canonicalize_name and make it ~3.7 tim...

Open Graph Description: We can apply @henryiii's improvement to packaging in pypa/packaging#1030 (see also https://iscinumpy.dev/post/packaging-faster/) to improve the performance of canonicalize_name and make it ~3.7...

X Description: We can apply @henryiii's improvement to packaging in pypa/packaging#1030 (see also https://iscinumpy.dev/post/packaging-faster/) to improve the performance of canonicalize_name and make it ...

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

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:c62700d4-2c7d-4a16-28ee-98a377d78a4c
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD45E:1CDFB5:68A07:9190B:6965258B
html-safe-noncef03e4623bfa778326aab5cd0cd91b0cf7935173ae28ef27ce53d72f4a85ed710
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDVFOjFDREZCNTo2OEEwNzo5MTkwQjo2OTY1MjU4QiIsInZpc2l0b3JfaWQiOiIyNzkyNTU5OTAxOTQ0MzkxMDUxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9262fcdd6438888f107945a7ae45c76c9471230c7dfb5132e617db4a2283a0df
hovercard-subject-tagpull_request:3162057244
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/143660/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/4887f29628c9854cbf23c8c3abd99741d516c4eece96f88fe97b8f61fcdf83d3/python/cpython/pull/143660
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4887f29628c9854cbf23c8c3abd99741d516c4eece96f88fe97b8f61fcdf83d3/python/cpython/pull/143660
og:image:altWe can apply @henryiii's improvement to packaging in pypa/packaging#1030 (see also https://iscinumpy.dev/post/packaging-faster/) to improve the performance of canonicalize_name and make it ~3.7...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamehugovk
hostnamegithub.com
expected-hostnamegithub.com
None817276b8a3521a687e743b852e21b1c4c62a9fabf649a41d85c1499aaa39fab1
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
release4a4c6d32d56fbcafaf5646e244c8989317f135a9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/143660#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F143660
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%2F143660
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/143660
Reloadhttps://github.com/python/cpython/pull/143660
Reloadhttps://github.com/python/cpython/pull/143660
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/143660
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71k 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/143660
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/143660#issue-comment-box
hugovkhttps://github.com/hugovk
python:mainhttps://github.com/python/cpython/tree/main
hugovk:3.15-importlib.metadata-canonicalize_namehttps://github.com/hugovk/cpython/tree/3.15-importlib.metadata-canonicalize_name
gh-143658: importlib.metadata: Use str.translate to improve performance of importlib.metadata.Prepared.normalized https://github.com/python/cpython/pull/143660#top
hugovkhttps://github.com/hugovk
python:mainhttps://github.com/python/cpython/tree/main
hugovk:3.15-importlib.metadata-canonicalize_namehttps://github.com/hugovk/cpython/tree/3.15-importlib.metadata-canonicalize_name
Conversation 22 https://github.com/python/cpython/pull/143660
Commits 7 https://github.com/python/cpython/pull/143660/commits
Checks 42 https://github.com/python/cpython/pull/143660/checks
Files changed 3 https://github.com/python/cpython/pull/143660/files
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/hugovk
hugovkhttps://github.com/hugovk
Jan 10, 2026https://github.com/python/cpython/pull/143660#issue-3799744285
Please reload this pagehttps://github.com/python/cpython/pull/143660
@henryiiihttps://github.com/henryiii
pypa/packaging#1030https://github.com/pypa/packaging/pull/1030
https://iscinumpy.dev/post/packaging-faster/https://iscinumpy.dev/post/packaging-faster/
https://gist.github.com/hugovk/efdbee0620cc64df7b405b52cf0b6e42https://gist.github.com/hugovk/efdbee0620cc64df7b405b52cf0b6e42
importlib.metadata: Use str.translate to improve performance of importlib.metadata.Prepared.normalized #143658https://github.com/python/cpython/issues/143658
Please reload this pagehttps://github.com/python/cpython/pull/143660
hugovkhttps://github.com/hugovk
January 10, 2026 14:29https://github.com/python/cpython/pull/143660#commits-pushed-76e2272
https://github.com/hugovk
https://github.com/henryiii
Use translate to improve performance of canonicalize_namehttps://github.com/python/cpython/pull/143660/commits/76e227242e311d068eb24e65c86253d08c7ffcf0
76e2272https://github.com/python/cpython/pull/143660/commits/76e227242e311d068eb24e65c86253d08c7ffcf0
https://github.com/hugovk
Add blurbhttps://github.com/python/cpython/pull/143660/commits/00c76fc7451ccb294bd890244aa17116239175e3
00c76fchttps://github.com/python/cpython/pull/143660/commits/00c76fc7451ccb294bd890244aa17116239175e3
https://github.com/hugovk
hugovkhttps://github.com/hugovk
jaracohttps://github.com/jaraco
warsawhttps://github.com/warsaw
code ownershttps://github.com/python/cpython/blob/aa8578dc54df2af9daa3353566359e602e5905cf/.github/CODEOWNERS#L495
January 10, 2026 13:44https://github.com/python/cpython/pull/143660#event-21963169842
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Jan 10, 2026https://github.com/python/cpython/pull/143660#event-21963170208
https://github.com/hugovk
hugovkhttps://github.com/hugovk
Jan 10, 2026https://github.com/python/cpython/pull/143660#event-21963171419
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Jan 10, 2026 https://github.com/python/cpython/pull/143660#ref-issue-3799740339
importlib.metadata: Use str.translate to improve performance of importlib.metadata.Prepared.normalized #143658 https://github.com/python/cpython/issues/143658
https://github.com/hugovk
hugovkhttps://github.com/hugovk
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
topic-importlib https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Atopic-importlib
Jan 10, 2026https://github.com/python/cpython/pull/143660#event-21963174125
https://github.com/picnixz
picnixzhttps://github.com/picnixz
Jan 10, 2026 https://github.com/python/cpython/pull/143660#pullrequestreview-3646867894
View reviewed changes https://github.com/python/cpython/pull/143660/files/00c76fc7451ccb294bd890244aa17116239175e3
Misc/NEWS.d/next/Library/2026-01-10-15-40-57.gh-issue-143658.Ox6pE5.rsthttps://github.com/python/cpython/pull/143660/files/00c76fc7451ccb294bd890244aa17116239175e3#diff-a3627d26c1469c38222bf4afb2e1fc79425a7d2e84e1194c0433f738e210d5e8
Please reload this pagehttps://github.com/python/cpython/pull/143660
https://github.com/picnixz
picnixzhttps://github.com/picnixz
Jan 10, 2026https://github.com/python/cpython/pull/143660#event-21963411129
https://github.com/hugovk
https://github.com/picnixz
Improve blurbhttps://github.com/python/cpython/pull/143660/commits/c1bb3ccfc0dfe93b644356e1e54ab2e8bc90e661
c1bb3cchttps://github.com/python/cpython/pull/143660/commits/c1bb3ccfc0dfe93b644356e1e54ab2e8bc90e661
https://github.com/picnixz
picnixzhttps://github.com/picnixz
Jan 10, 2026 https://github.com/python/cpython/pull/143660#pullrequestreview-3646920416
View reviewed changes https://github.com/python/cpython/pull/143660/files/c1bb3ccfc0dfe93b644356e1e54ab2e8bc90e661
picnixzhttps://github.com/picnixz
https://github.com/python/cpython/pull/143660#pullrequestreview-3646920416
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/143660
Lib/importlib/metadata/__init__.pyhttps://github.com/python/cpython/pull/143660/files/c1bb3ccfc0dfe93b644356e1e54ab2e8bc90e661#diff-cfd40902fc2c4024fa906881ab8112e93a934cea80c6ffe5f45f29f80150c256
Please reload this pagehttps://github.com/python/cpython/pull/143660
hugovkhttps://github.com/hugovk
January 10, 2026 17:16https://github.com/python/cpython/pull/143660#commits-pushed-0eae552
https://github.com/hugovk
https://github.com/picnixz
Improve commenthttps://github.com/python/cpython/pull/143660/commits/0eae55202f7a2413637e39df83c0953a06ddfae3
0eae552https://github.com/python/cpython/pull/143660/commits/0eae55202f7a2413637e39df83c0953a06ddfae3
https://github.com/hugovk
Add tests for Prepared.normalizehttps://github.com/python/cpython/pull/143660/commits/1657880f0fad56be0483d6d1d6c9d9e66b21e1ee
1657880https://github.com/python/cpython/pull/143660/commits/1657880f0fad56be0483d6d1d6c9d9e66b21e1ee
https://github.com/hugovk
Fix linthttps://github.com/python/cpython/pull/143660/commits/ee0e6aa3b276de216a760502fd7060ec878385d9
ee0e6aahttps://github.com/python/cpython/pull/143660/commits/ee0e6aa3b276de216a760502fd7060ec878385d9
https://github.com/johnslavik
johnslavikhttps://github.com/johnslavik
Jan 10, 2026 https://github.com/python/cpython/pull/143660#pullrequestreview-3647041034
View reviewed changes https://github.com/python/cpython/pull/143660/files/ee0e6aa3b276de216a760502fd7060ec878385d9
johnslavikhttps://github.com/johnslavik
https://github.com/python/cpython/pull/143660#pullrequestreview-3647041034
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/143660
Lib/test/test_importlib/metadata/test_api.pyhttps://github.com/python/cpython/pull/143660/files/ee0e6aa3b276de216a760502fd7060ec878385d9#diff-80486327043c2bbdd6af50e72788bb799270e0bff19633b77cefbc99fe163059
Please reload this pagehttps://github.com/python/cpython/pull/143660
Lib/importlib/metadata/__init__.pyhttps://github.com/python/cpython/pull/143660/files/ee0e6aa3b276de216a760502fd7060ec878385d9#diff-cfd40902fc2c4024fa906881ab8112e93a934cea80c6ffe5f45f29f80150c256
Please reload this pagehttps://github.com/python/cpython/pull/143660
https://github.com/henryiii
henryiiihttps://github.com/henryiii
Jan 10, 2026 https://github.com/python/cpython/pull/143660#ref-pullrequest-3800071547
perf: tiny import time improvement and simplification pypa/packaging#1047 https://github.com/pypa/packaging/pull/1047
https://github.com/hugovk
https://github.com/johnslavik
Add extra test case with repeated separatorhttps://github.com/python/cpython/pull/143660/commits/7b7f9a8773cc12f54ff987e6c6fa8ffcbf3a6000
7b7f9a8https://github.com/python/cpython/pull/143660/commits/7b7f9a8773cc12f54ff987e6c6fa8ffcbf3a6000
https://github.com/a12k
a12khttps://github.com/a12k
Jan 10, 2026 https://github.com/python/cpython/pull/143660#pullrequestreview-3647204892
View reviewed changes https://github.com/python/cpython/pull/143660/files/7b7f9a8773cc12f54ff987e6c6fa8ffcbf3a6000
Lib/importlib/metadata/__init__.pyhttps://github.com/python/cpython/pull/143660/files/7b7f9a8773cc12f54ff987e6c6fa8ffcbf3a6000#diff-cfd40902fc2c4024fa906881ab8112e93a934cea80c6ffe5f45f29f80150c256
a12khttps://github.com/a12k
Jan 10, 2026https://github.com/python/cpython/pull/143660#discussion_r2678987701
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@hugovkhttps://github.com/hugovk
Please reload this pagehttps://github.com/python/cpython/pull/143660
picnixzhttps://github.com/picnixz
Jan 10, 2026https://github.com/python/cpython/pull/143660#discussion_r2678992224
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/143660
a12khttps://github.com/a12k
Jan 10, 2026https://github.com/python/cpython/pull/143660#discussion_r2679007496
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/143660
picnixzhttps://github.com/picnixz
Jan 10, 2026https://github.com/python/cpython/pull/143660#discussion_r2679018527
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/143660
hugovkhttps://github.com/hugovk
Jan 10, 2026https://github.com/python/cpython/pull/143660#discussion_r2679030881
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/143660
a12khttps://github.com/a12k
Jan 10, 2026https://github.com/python/cpython/pull/143660#discussion_r2679031712
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/143660
a12khttps://github.com/a12k
Jan 10, 2026https://github.com/python/cpython/pull/143660#discussion_r2679034917
Please reload this pagehttps://github.com/python/cpython/pull/143660
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@hugovkhttps://github.com/hugovk
Please reload this pagehttps://github.com/python/cpython/pull/143660
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%2F143660
https://github.com/picnixz
picnixz https://github.com/picnixz
https://github.com/python/cpython/pull/143660/files/7b7f9a8773cc12f54ff987e6c6fa8ffcbf3a6000
https://github.com/johnslavik
johnslavik https://github.com/johnslavik
https://github.com/python/cpython/pull/143660/files/ee0e6aa3b276de216a760502fd7060ec878385d9
https://github.com/jaraco
jaraco https://github.com/jaraco
https://github.com/warsaw
warsaw https://github.com/warsaw
https://github.com/henryiii
henryiii https://github.com/henryiii
https://github.com/python/cpython/pull/143660/files/ee0e6aa3b276de216a760502fd7060ec878385d9
https://github.com/a12k
a12k https://github.com/a12k
https://github.com/python/cpython/pull/143660/files/7b7f9a8773cc12f54ff987e6c6fa8ffcbf3a6000
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
topic-importlib https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Atopic-importlib
Please reload this pagehttps://github.com/python/cpython/pull/143660
https://github.com/hugovk
https://github.com/henryiii
https://github.com/a12k
https://github.com/picnixz
https://github.com/johnslavik
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.