René's URL Explorer Experiment


Title: gh-118761: Optimise import time for ``shlex`` by AA-Turner · Pull Request #132036 · python/cpython · GitHub

Open Graph Title: gh-118761: Optimise import time for ``shlex`` by AA-Turner · Pull Request #132036 · python/cpython

X Title: gh-118761: Optimise import time for ``shlex`` by AA-Turner · Pull Request #132036 · python/cpython

Description: This PR achieves a 33x improvement in import time for the shlex module and a 4-12x improvement in performance for shlex.quote. Current: import shlex: cumulative time mean: 9065.967 µs median: 9092....

Open Graph Description: This PR achieves a 33x improvement in import time for the shlex module and a 4-12x improvement in performance for shlex.quote. Current: import shlex: cumulative time mean: 9065.967 µs median: 9092....

X Description: This PR achieves a 33x improvement in import time for the shlex module and a 4-12x improvement in performance for shlex.quote. Current: import shlex: cumulative time mean: 9065.967 µs median: 9092....

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

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:88e63fec-ba33-cd43-8d08-c12598ed10c6
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB6DA:22199A:FC2C3C:151DC4C:696991B2
html-safe-nonce7cab57a48bae07175fd891f499601a7a59807c4e1283cb4e3ef7d82f63801891
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkRBOjIyMTk5QTpGQzJDM0M6MTUxREM0Qzo2OTY5OTFCMiIsInZpc2l0b3JfaWQiOiI0MTYzNjE1NzY0NjUzOTA0MzA2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9260ea688fc8c5a13b6f9817a2b2d4900aed428dd6be8801f290b80405915d25
hovercard-subject-tagpull_request:2435482122
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/132036/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/61d8e4d8c81923ffd5c7da49ad8a64ba0fa486c3d325f0bda9582adeddfd32b4/python/cpython/pull/132036
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/61d8e4d8c81923ffd5c7da49ad8a64ba0fa486c3d325f0bda9582adeddfd32b4/python/cpython/pull/132036
og:image:altThis PR achieves a 33x improvement in import time for the shlex module and a 4-12x improvement in performance for shlex.quote. Current: import shlex: cumulative time mean: 9065.967 µs median: 9092....
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAA-Turner
hostnamegithub.com
expected-hostnamegithub.com
None3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751
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
releaseaf80af7cc9e3de9c336f18b208a600950a3c187c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/132036#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F132036
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%2F132036
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/132036
Reloadhttps://github.com/python/cpython/pull/132036
Reloadhttps://github.com/python/cpython/pull/132036
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/132036
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/132036
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/132036#issue-comment-box
AA-Turnerhttps://github.com/AA-Turner
python:mainhttps://github.com/python/cpython/tree/main
AA-Turner:opt-shlexhttps://github.com/AA-Turner/cpython/tree/opt-shlex
gh-118761: Optimise import time for shlex https://github.com/python/cpython/pull/132036#top
AA-Turnerhttps://github.com/AA-Turner
python:mainhttps://github.com/python/cpython/tree/main
AA-Turner:opt-shlexhttps://github.com/AA-Turner/cpython/tree/opt-shlex
Conversation 12 https://github.com/python/cpython/pull/132036
Commits 6 https://github.com/python/cpython/pull/132036/commits
Checks 37 https://github.com/python/cpython/pull/132036/checks
Files changed https://github.com/python/cpython/pull/132036/files
Please reload this pagehttps://github.com/python/cpython/pull/132036
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/AA-Turner
AA-Turnerhttps://github.com/AA-Turner
Apr 2, 2025https://github.com/python/cpython/pull/132036#issue-2967816044
Please reload this pagehttps://github.com/python/cpython/pull/132036
Improve import time of various stdlib modules #118761https://github.com/python/cpython/issues/118761
Please reload this pagehttps://github.com/python/cpython/pull/132036
https://github.com/AA-Turner
Optimise import time for shlexhttps://github.com/python/cpython/pull/132036/commits/1fd83f134473efe04b390b7038fec9bc01d5940f
1fd83f1https://github.com/python/cpython/pull/132036/commits/1fd83f134473efe04b390b7038fec9bc01d5940f
https://github.com/AA-Turner
AA-Turnerhttps://github.com/AA-Turner
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
Apr 2, 2025https://github.com/python/cpython/pull/132036#event-17102537058
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
Apr 2, 2025https://github.com/python/cpython/pull/132036#event-17102537349
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Apr 2, 2025 https://github.com/python/cpython/pull/132036#ref-issue-2285570381
Improve import time of various stdlib modules #118761 https://github.com/python/cpython/issues/118761
https://github.com/rruuaanng
rruuaannghttps://github.com/rruuaanng
Apr 3, 2025 https://github.com/python/cpython/pull/132036#pullrequestreview-2738711217
View reviewed changes https://github.com/python/cpython/pull/132036/files/1fd83f134473efe04b390b7038fec9bc01d5940f
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
Apr 4, 2025https://github.com/python/cpython/pull/132036#issuecomment-2778714376
Please reload this pagehttps://github.com/python/cpython/pull/132036
https://github.com/AA-Turner
Revert deferral of sys and iohttps://github.com/python/cpython/pull/132036/commits/8811463aed98455641958e4a64cf7ba242ac283e
8811463https://github.com/python/cpython/pull/132036/commits/8811463aed98455641958e4a64cf7ba242ac283e
https://github.com/AA-Turner
AA-Turnerhttps://github.com/AA-Turner
Apr 4, 2025https://github.com/python/cpython/pull/132036#issuecomment-2779020226
Please reload this pagehttps://github.com/python/cpython/pull/132036
Please reload this pagehttps://github.com/python/cpython/pull/132036
https://github.com/picnixz
picnixzhttps://github.com/picnixz
Apr 4, 2025 https://github.com/python/cpython/pull/132036#pullrequestreview-2743523487
View reviewed changes https://github.com/python/cpython/pull/132036/files/8811463aed98455641958e4a64cf7ba242ac283e
Lib/shlex.pyhttps://github.com/python/cpython/pull/132036/files/8811463aed98455641958e4a64cf7ba242ac283e#diff-247132f798c75b6319bb86d174c5c31ffb009764dd1d155ec1008a380cf5fa81
Please reload this pagehttps://github.com/python/cpython/pull/132036
Lib/shlex.pyhttps://github.com/python/cpython/pull/132036/files/8811463aed98455641958e4a64cf7ba242ac283e#diff-247132f798c75b6319bb86d174c5c31ffb009764dd1d155ec1008a380cf5fa81
Please reload this pagehttps://github.com/python/cpython/pull/132036
https://github.com/AA-Turner
Switch to bytes.translate() based approachhttps://github.com/python/cpython/pull/132036/commits/bd6916a9d45e68ce9f5de60f79cb0d9e049eb61d
bd6916ahttps://github.com/python/cpython/pull/132036/commits/bd6916a9d45e68ce9f5de60f79cb0d9e049eb61d
https://github.com/picnixz
picnixzhttps://github.com/picnixz
Apr 6, 2025 https://github.com/python/cpython/pull/132036#pullrequestreview-2745070547
View reviewed changes https://github.com/python/cpython/pull/132036/files/bd6916a9d45e68ce9f5de60f79cb0d9e049eb61d
Lib/shlex.pyhttps://github.com/python/cpython/pull/132036/files/8811463aed98455641958e4a64cf7ba242ac283e..bd6916a9d45e68ce9f5de60f79cb0d9e049eb61d#diff-247132f798c75b6319bb86d174c5c31ffb009764dd1d155ec1008a380cf5fa81
Please reload this pagehttps://github.com/python/cpython/pull/132036
https://github.com/apps/python-cla-bot
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F132036
AA-Turnerhttps://github.com/AA-Turner
April 18, 2025 02:50https://github.com/python/cpython/pull/132036#commits-pushed-192329e
https://github.com/AA-Turner
Update Lib/shlex.pyhttps://github.com/python/cpython/pull/132036/commits/192329ea333c1e19e5ef251161afe4f221217a78
192329ehttps://github.com/python/cpython/pull/132036/commits/192329ea333c1e19e5ef251161afe4f221217a78
https://github.com/AA-Turner
Merge branch 'main' into opt-shlexhttps://github.com/python/cpython/pull/132036/commits/cc130affb1baf4f6ee037767ba145b3a7b2af301
cc130afhttps://github.com/python/cpython/pull/132036/commits/cc130affb1baf4f6ee037767ba145b3a7b2af301
https://github.com/AA-Turner
AA-Turnerhttps://github.com/AA-Turner
picnixzhttps://github.com/picnixz
April 20, 2025 21:50https://github.com/python/cpython/pull/132036#event-17332307222
https://github.com/rruuaanng
rruuaannghttps://github.com/rruuaanng
Apr 21, 2025 https://github.com/python/cpython/pull/132036#pullrequestreview-2780368616
View reviewed changes https://github.com/python/cpython/pull/132036/files/cc130affb1baf4f6ee037767ba145b3a7b2af301
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
Apr 21, 2025 https://github.com/python/cpython/pull/132036#pullrequestreview-2780371439
View reviewed changes https://github.com/python/cpython/pull/132036/files/cc130affb1baf4f6ee037767ba145b3a7b2af301
Lib/shlex.pyhttps://github.com/python/cpython/pull/132036/files/cc130affb1baf4f6ee037767ba145b3a7b2af301#diff-247132f798c75b6319bb86d174c5c31ffb009764dd1d155ec1008a380cf5fa81
Please reload this pagehttps://github.com/python/cpython/pull/132036
https://github.com/AA-Turner
Add test_lazy_importshttps://github.com/python/cpython/pull/132036/commits/4a640ce2f34753d8c0c55f3cecdaa1f406f3dd00
4a640cehttps://github.com/python/cpython/pull/132036/commits/4a640ce2f34753d8c0c55f3cecdaa1f406f3dd00
https://github.com/AA-Turner
AA-Turnerhttps://github.com/AA-Turner
JelleZijlstrahttps://github.com/JelleZijlstra
April 21, 2025 00:34https://github.com/python/cpython/pull/132036#event-17332682370
https://github.com/AA-Turner
AA-Turnerhttps://github.com/AA-Turner
06a26fdhttps://github.com/python/cpython/commit/06a26fda607fb1a5e108cf82a0458c8ebf97f5d2
Apr 24, 2025https://github.com/python/cpython/pull/132036#event-17392507252
Please reload this pagehttps://github.com/python/cpython/pull/132036
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
Apr 24, 2025https://github.com/python/cpython/pull/132036#event-17392508298
https://github.com/AA-Turner
AA-Turnerhttps://github.com/AA-Turner
April 24, 2025 15:10https://github.com/python/cpython/pull/132036#event-17392508326
https://github.com/cybit
cybithttps://github.com/cybit
Sep 11, 2025 https://github.com/python/cpython/pull/132036#ref-issue-3407708064
Exception thrown by shlex.quote changed in 3.14 and is not documented #138804 https://github.com/python/cpython/issues/138804
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%2F132036
https://github.com/picnixz
picnixz https://github.com/picnixz
https://github.com/JelleZijlstra
JelleZijlstra https://github.com/JelleZijlstra
https://github.com/rruuaanng
rruuaanng https://github.com/rruuaanng
https://github.com/python/cpython/pull/132036/files/cc130affb1baf4f6ee037767ba145b3a7b2af301
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
Please reload this pagehttps://github.com/python/cpython/pull/132036
https://github.com/AA-Turner
https://github.com/JelleZijlstra
https://github.com/picnixz
https://github.com/rruuaanng
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.