René's URL Explorer Experiment


Title: gh-137855: `email.quoprimime` removing `re` import by Marius-Juston · Pull Request #132046 · python/cpython · GitHub

Open Graph Title: gh-137855: `email.quoprimime` removing `re` import by Marius-Juston · Pull Request #132046 · python/cpython

X Title: gh-137855: `email.quoprimime` removing `re` import by Marius-Juston · Pull Request #132046 · python/cpython

Description: This pull request removes the re module from the email.quoprimime, thus increasing the import speed from 5676 us to 3669 us (a 60% import speed increase ); From marius@DESKTOP-IOUM5DH:~/cpython$ ./python -X importtime -c "import email.quoprimime" import time: self [us] | cumulative | imported package import time: 88 | 88 | _io import time: 19 | 19 | marshal import time: 143 | 143 | posix import time: 332 | 580 | _frozen_importlib_external import time: 42 | 42 | time import time: 125 | 166 | zipimport import time: 25 | 25 | _codecs import time: 290 | 315 | codecs import time: 190 | 190 | encodings.aliases import time: 417 | 921 | encodings import time: 90 | 90 | encodings.utf_8 import time: 44 | 44 | _signal import time: 22 | 22 | _abc import time: 93 | 114 | abc import time: 484 | 484 | _collections_abc import time: 136 | 733 | io import time: 22 | 22 | _stat import time: 59 | 80 | stat import time: 31 | 31 | errno import time: 43 | 43 | genericpath import time: 87 | 160 | posixpath import time: 283 | 523 | os import time: 50 | 50 | _sitebuiltins import time: 86 | 86 | sitecustomize import time: 30 | 30 | usercustomize import time: 216 | 902 | site import time: 114 | 114 | linecache import time: 203 | 203 | email import time: 22 | 22 | _string import time: 140 | 140 | types import time: 795 | 935 | enum import time: 34 | 34 | _sre import time: 130 | 130 | re._constants import time: 181 | 311 | re._parser import time: 49 | 49 | re._casefix import time: 198 | 591 | re._compiler import time: 57 | 57 | itertools import time: 75 | 75 | keyword import time: 41 | 41 | _operator import time: 153 | 194 | operator import time: 98 | 98 | reprlib import time: 32 | 32 | _collections import time: 553 | 1006 | collections import time: 30 | 30 | _functools import time: 346 | 1381 | functools import time: 95 | 95 | copyreg import time: 311 | 3311 | re import time: 365 | 3697 | string import time: 1777 | 5676 | email.quoprimime To marius@DESKTOP-IOUM5DH:~/cpython$ ./python -X importtime -c "import email.quoprimime" import time: self [us] | cumulative | imported package import time: 89 | 89 | _io import time: 18 | 18 | marshal import time: 130 | 130 | posix import time: 305 | 541 | _frozen_importlib_external import time: 37 | 37 | time import time: 115 | 152 | zipimport import time: 24 | 24 | _codecs import time: 273 | 296 | codecs import time: 175 | 175 | encodings.aliases import time: 387 | 857 | encodings import time: 83 | 83 | encodings.utf_8 import time: 40 | 40 | _signal import time: 16 | 16 | _abc import time: 88 | 103 | abc import time: 422 | 422 | _collections_abc import time: 125 | 649 | io import time: 20 | 20 | _stat import time: 54 | 73 | stat import time: 29 | 29 | errno import time: 39 | 39 | genericpath import time: 81 | 148 | posixpath import time: 269 | 490 | os import time: 48 | 48 | _sitebuiltins import time: 80 | 80 | sitecustomize import time: 28 | 28 | usercustomize import time: 199 | 842 | site import time: 106 | 106 | linecache import time: 189 | 189 | email import time: 18 | 18 | _string import time: 124 | 124 | types import time: 667 | 791 | enum import time: 33 | 33 | _sre import time: 130 | 130 | re._constants import time: 177 | 307 | re._parser import time: 49 | 49 | re._casefix import time: 179 | 566 | re._compiler import time: 58 | 58 | itertools import time: 74 | 74 | keyword import time: 36 | 36 | _operator import time: 148 | 183 | operator import time: 96 | 96 | reprlib import time: 31 | 31 | _collections import time: 494 | 934 | collections import time: 27 | 27 | _functools import time: 315 | 1274 | functools import time: 87 | 87 | copyreg import time: 284 | 3000 | re import time: 297 | 3314 | string import time: 168 | 3669 | email.quoprimime however, the new implementation does increase the compute time TEST_CASES = { "empty": "Dracula", "empty_medium": "Dracula"* 10, "empty_long": "Dracula"* 100, "short": "Hello=20World=21", "medium": "This_is_a_test=3F=3D=2E" * 10, "long": "Some_long_text_with_encoding=20" * 100, "mixed": "A=2Equick=20brown=5Ffox=21=3F" * 50, "edge_case_short": "=20=21=3F=2E=5F", "edge_case_long": "=20=21=3F=2E=5F" * 200 } Benchmark regex non_regex empty 284 ns 382 ns: 1.34x slower empty_medium 302 ns 2.99 us: 9.91x slower empty_long 371 ns 28.6 us: 77.20x slower short 731 ns 902 ns: 1.23x slower medium 6.24 us 11.8 us: 1.89x slower long 25.5 us 137 us: 5.37x slower mixed 57.0 us 71.5 us: 1.25x slower edge_case_short 1.36 us 916 ns: 1.48x faster edge_case_long 178 us 160 us: 1.11x faster Geometric mean (ref) 2.78x slower So it is very possible that this is not worth it. Issues: gh-130167 gh-118761 Issue: gh-137855

Open Graph Description: This pull request removes the re module from the email.quoprimime, thus increasing the import speed from 5676 us to 3669 us (a 60% import speed increase ); From marius@DESKTOP-IOUM5DH:~/cpython$ ./...

X Description: This pull request removes the re module from the email.quoprimime, thus increasing the import speed from 5676 us to 3669 us (a 60% import speed increase ); From marius@DESKTOP-IOUM5DH:~/cpython$ ./...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:751b5284-0638-4051-8f53-a27be996e420
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAFB4:1EEB64:117A200:17FE202:6969F85E
html-safe-nonceb38ca7269bbf334311114f1e3a1d4ed6893f788000bdd602936ece81d9148e69
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkI0OjFFRUI2NDoxMTdBMjAwOjE3RkUyMDI6Njk2OUY4NUUiLCJ2aXNpdG9yX2lkIjoiMzg4MTU2MzAyNDY0NzY0OTM3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacbdca770ec1073ca7002f7157d9314edcce398d8fc42c325bd00534761b2c7e42
hovercard-subject-tagpull_request:2436592272
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/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/132046/files
twitter:imagehttps://avatars.githubusercontent.com/u/19751068?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/19751068?s=400&v=4
og:image:altThis pull request removes the re module from the email.quoprimime, thus increasing the import speed from 5676 us to 3669 us (a 60% import speed increase ); From marius@DESKTOP-IOUM5DH:~/cpython$ ./...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8
turbo-cache-controlno-preview
diff-viewunified
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-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasebdde15ad1b403e23b08bbd89b53fbe6bdf688cad
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/132046/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F132046%2Ffiles
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%2F132046%2Ffiles
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%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/132046/files
Reloadhttps://github.com/python/cpython/pull/132046/files
Reloadhttps://github.com/python/cpython/pull/132046/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/132046/files
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/132046/files
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
Marius-Justonhttps://github.com/Marius-Juston
python:mainhttps://github.com/python/cpython/tree/main
Marius-Juston:quoprimimehttps://github.com/Marius-Juston/cpython/tree/quoprimime
Conversation 16 https://github.com/python/cpython/pull/132046
Commits 11 https://github.com/python/cpython/pull/132046/commits
Checks 38 https://github.com/python/cpython/pull/132046/checks
Files changed https://github.com/python/cpython/pull/132046/files
Please reload this pagehttps://github.com/python/cpython/pull/132046/files
gh-137855: email.quoprimime removing re import https://github.com/python/cpython/pull/132046/files#top
Show all changes 11 commits https://github.com/python/cpython/pull/132046/files
c670b11 Removed re hex Marius-Juston Apr 3, 2025 https://github.com/python/cpython/pull/132046/commits/c670b112683e89e9a1d80842f51cdfbb6e43ae4f
08cdc0b implace replace, removed valid_hex parameter Marius-Juston Apr 3, 2025 https://github.com/python/cpython/pull/132046/commits/08cdc0b97a4354a5b0b4afc2380c9fcc3d70d76b
a3ef550 joined to big if statement Marius-Juston Apr 3, 2025 https://github.com/python/cpython/pull/132046/commits/a3ef5506062fb54012901899f0875b5f24e67dfd
22e6d9e added news Marius-Juston Apr 3, 2025 https://github.com/python/cpython/pull/132046/commits/22e6d9e16cc349976096672a5ac6b9e3c40519bf
232bb55 inline character assigment Marius-Juston Apr 3, 2025 https://github.com/python/cpython/pull/132046/commits/232bb559d737b7be48c75c78aad828b36b8614e6
3ada67a use cache for hex to char + instead of single character append use sl… Marius-Juston Apr 3, 2025 https://github.com/python/cpython/pull/132046/commits/3ada67a5a2c3c11af0c64f9434ffc9cfa0b0e905
9e3cc1f inplace assignment with walrus Marius-Juston Apr 3, 2025 https://github.com/python/cpython/pull/132046/commits/9e3cc1f227a435f24bfc184e24f777d55061e65a
3287564 removed news since should probably be "skip news" tagged Marius-Juston Apr 3, 2025 https://github.com/python/cpython/pull/132046/commits/328756485b8979f1df24a4924b06544d5efcd6ca
8362a2e fast pass for no '=' Marius-Juston Apr 3, 2025 https://github.com/python/cpython/pull/132046/commits/8362a2e6e76a271efa96393b06799861c99f7158
81ae23a Update Lib/email/quoprimime.py Marius-Juston Apr 4, 2025 https://github.com/python/cpython/pull/132046/commits/81ae23a47ef8a5c1c527e75244dfcfbc7a42f531
8659486 faster string concatenation Marius-Juston Apr 4, 2025 https://github.com/python/cpython/pull/132046/commits/865948664eb15f178d714b599a1a291a594b9360
Clear filters https://github.com/python/cpython/pull/132046/files
Please reload this pagehttps://github.com/python/cpython/pull/132046/files
Please reload this pagehttps://github.com/python/cpython/pull/132046/files
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L441
Lib/email/quoprimime.pyhttps://github.com/python/cpython/pull/132046/files#diff-67c5795c2d08bb58a593991bb05448532adce2f9a635a61a0c68469ac8964479
View file https://github.com/Marius-Juston/cpython/blob/865948664eb15f178d714b599a1a291a594b9360/Lib/email/quoprimime.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/132046/{{ revealButtonHref }}
https://github.com/python/cpython/pull/132046/files#diff-67c5795c2d08bb58a593991bb05448532adce2f9a635a61a0c68469ac8964479
https://github.com/python/cpython/pull/132046/files#diff-67c5795c2d08bb58a593991bb05448532adce2f9a635a61a0c68469ac8964479
https://github.com/python/cpython/pull/132046/files#diff-67c5795c2d08bb58a593991bb05448532adce2f9a635a61a0c68469ac8964479
https://github.com/python/cpython/pull/132046/files#diff-67c5795c2d08bb58a593991bb05448532adce2f9a635a61a0c68469ac8964479
terryjreedyhttps://github.com/terryjreedy
Aug 16, 2025https://github.com/python/cpython/pull/132046/files#r2280460646
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/132046/files
Please reload this pagehttps://github.com/python/cpython/pull/132046/files
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.