René's URL Explorer Experiment


Title: gh-109653: Speedup import of threading module by danielhollas · Pull Request #114509 · python/cpython · GitHub

Open Graph Title: gh-109653: Speedup import of threading module by danielhollas · Pull Request #114509 · python/cpython

X Title: gh-109653: Speedup import of threading module by danielhollas · Pull Request #114509 · python/cpython

Description: Delayed import of functools speeds up the import threading by ~50% (2ms -> 1ms) in my testing. Since the functools module is only used in the internal _register_atexit function that is called by co...

Open Graph Description: Delayed import of functools speeds up the import threading by ~50% (2ms -> 1ms) in my testing. Since the functools module is only used in the internal _register_atexit function that is called by...

X Description: Delayed import of functools speeds up the import threading by ~50% (2ms -> 1ms) in my testing. Since the functools module is only used in the internal _register_atexit function that is calle...

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

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:38550fe3-8dd4-bdcc-a9b9-f36cb8d50c95
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA562:28B0D7:D482B7:12B06BB:696A23BA
html-safe-nonce9d2b67bd0a36e9472d9928ae6ced56faef6f9b49101538d8b15b84571be7bf44
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTYyOjI4QjBENzpENDgyQjc6MTJCMDZCQjo2OTZBMjNCQSIsInZpc2l0b3JfaWQiOiI4ODEwNjUwMTc1Njc2MjI4NTM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac21652ac42b57d0592f970e026942b5e685d2369e6c74cbc72f422deb87a2bd12
hovercard-subject-tagpull_request:1692702849
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/114509/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/7ee101f0834332e36588a38d18226917f211896947bd279c18f37801b314ad19/python/cpython/pull/114509
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7ee101f0834332e36588a38d18226917f211896947bd279c18f37801b314ad19/python/cpython/pull/114509
og:image:altDelayed import of functools speeds up the import threading by ~50% (2ms -> 1ms) in my testing. Since the functools module is only used in the internal _register_atexit function that is called by...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedanielhollas
hostnamegithub.com
expected-hostnamegithub.com
None014f3d193f36b7d393f88ca22d06fbacd370800b40a547c1ea67291e02dc8ea3
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
released515f6f09fa57a93bf90355cb894eb84ca4f458f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/114509#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F114509
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%2F114509
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/114509
Reloadhttps://github.com/python/cpython/pull/114509
Reloadhttps://github.com/python/cpython/pull/114509
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/114509
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/114509
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/114509#issue-comment-box
AlexWaygoodhttps://github.com/AlexWaygood
python:mainhttps://github.com/python/cpython/tree/main
danielhollas:import-threading-speeduphttps://github.com/danielhollas/cpython/tree/import-threading-speedup
gh-109653: Speedup import of threading module https://github.com/python/cpython/pull/114509#top
AlexWaygoodhttps://github.com/AlexWaygood
python:mainhttps://github.com/python/cpython/tree/main
danielhollas:import-threading-speeduphttps://github.com/danielhollas/cpython/tree/import-threading-speedup
Conversation 13 https://github.com/python/cpython/pull/114509
Commits 3 https://github.com/python/cpython/pull/114509/commits
Checks 0 https://github.com/python/cpython/pull/114509/checks
Files changed https://github.com/python/cpython/pull/114509/files
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/danielhollas
danielhollashttps://github.com/danielhollas
Jan 23, 2024https://github.com/python/cpython/pull/114509#issue-2097135637
Please reload this pagehttps://github.com/python/cpython/pull/114509
#109653https://github.com/python/cpython/issues/109653
@AlexWaygoodhttps://github.com/AlexWaygood
Improve import time of various stdlib modules #109653https://github.com/python/cpython/issues/109653
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/danielhollas
Speed up import of threading modulehttps://github.com/python/cpython/pull/114509/commits/2a73912c9cbb579207ff6ca4eeff78c2fddd3d69
2a73912https://github.com/python/cpython/pull/114509/commits/2a73912c9cbb579207ff6ca4eeff78c2fddd3d69
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22
Jan 23, 2024https://github.com/python/cpython/pull/114509#event-11577071873
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Jan 23, 2024 https://github.com/python/cpython/pull/114509#ref-issue-1907228354
Improve import time of various stdlib modules #109653 https://github.com/python/cpython/issues/109653
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Jan 23, 2024https://github.com/python/cpython/pull/114509#issuecomment-1907069766
require a NEWS entryhttps://devguide.python.org/committing/#updating-news-and-what-s-new-in-python
blurb_ithttps://blurb-it.herokuapp.com
blurbhttps://pypi.org/project/blurb/
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/apps/blurb-it
📜🤖 Added by blurb_it.https://github.com/python/cpython/pull/114509/commits/b70b7e58cadf34b133292014c8cf84dd84f49d9f
b70b7e5https://github.com/python/cpython/pull/114509/commits/b70b7e58cadf34b133292014c8cf84dd84f49d9f
https://github.com/danielhollas
danielhollashttps://github.com/danielhollas
Jan 24, 2024https://github.com/python/cpython/pull/114509#issuecomment-1907149443
Please reload this pagehttps://github.com/python/cpython/pull/114509
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/Eclips4
Eclips4https://github.com/Eclips4
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
Jan 24, 2024https://github.com/python/cpython/pull/114509#event-11579663525
https://github.com/ajoino
ajoinohttps://github.com/ajoino
Jan 24, 2024https://github.com/python/cpython/pull/114509#issuecomment-1908037034
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
Jan 24, 2024https://github.com/python/cpython/pull/114509#issuecomment-1908046465
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/danielhollas
danielhollashttps://github.com/danielhollas
Jan 24, 2024https://github.com/python/cpython/pull/114509#issuecomment-1908139037
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
Jan 24, 2024https://github.com/python/cpython/pull/114509#issuecomment-1908152115
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
Jan 24, 2024 https://github.com/python/cpython/pull/114509#pullrequestreview-1841415967
View reviewed changes https://github.com/python/cpython/pull/114509/files/b70b7e58cadf34b133292014c8cf84dd84f49d9f
Lib/threading.pyhttps://github.com/python/cpython/pull/114509/files/b70b7e58cadf34b133292014c8cf84dd84f49d9f#diff-b250d3d0e0d909784a67083e9069ce507513a67e8514a011e2f364027e25e0b0
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/danielhollas
https://github.com/AlexWaygood
Let's got with lambda instead of functools.partialhttps://github.com/python/cpython/pull/114509/commits/e76cec2d321817c0914b7693dc7c1fac98bdc67b
e76cec2https://github.com/python/cpython/pull/114509/commits/e76cec2d321817c0914b7693dc7c1fac98bdc67b
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
Jan 24, 2024 https://github.com/python/cpython/pull/114509#pullrequestreview-1841486332
View reviewed changes https://github.com/python/cpython/pull/114509/files/e76cec2d321817c0914b7693dc7c1fac98bdc67b
AlexWaygoodhttps://github.com/AlexWaygood
https://github.com/python/cpython/pull/114509#pullrequestreview-1841486332
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
specifically addedhttps://github.com/python/cpython/commit/b61b818d916942aad1f8f3e33181801c4a1ed14b
@ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
awaiting review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22
Jan 24, 2024https://github.com/python/cpython/pull/114509#event-11585019670
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
January 24, 2024 14:18https://github.com/python/cpython/pull/114509#event-11585021452
https://github.com/danielhollas
danielhollashttps://github.com/danielhollas
Jan 24, 2024https://github.com/python/cpython/pull/114509#issuecomment-1908335242
@AlexWaygoodhttps://github.com/AlexWaygood
@ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/danielhollas
danielhollashttps://github.com/danielhollas
Jan 24, 2024 https://github.com/python/cpython/pull/114509#ref-pullrequest-2037283375
gh-109653: Improve import time of logging by lazy loading traceback #112995 https://github.com/python/cpython/pull/112995
https://github.com/danielhollas
danielhollashttps://github.com/danielhollas
Jan 24, 2024https://github.com/python/cpython/pull/114509#event-11590481239
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
Jan 31, 2024https://github.com/python/cpython/pull/114509#issuecomment-1918713898
@danielhollashttps://github.com/danielhollas
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
5e390a0https://github.com/python/cpython/commit/5e390a0fc825f21952beb158e2bda3c5e007fac9
Jan 31, 2024https://github.com/python/cpython/pull/114509#event-11653055139
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
Jan 31, 2024https://github.com/python/cpython/pull/114509#event-11653055802
https://github.com/danielhollas
danielhollashttps://github.com/danielhollas
January 31, 2024 10:59https://github.com/python/cpython/pull/114509#event-11654161413
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Feb 1, 2024https://github.com/python/cpython/pull/114509#issuecomment-1922252601
@ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Feb 1, 2024 https://github.com/python/cpython/pull/114509#pullrequestreview-1857652950
View reviewed changes https://github.com/python/cpython/pull/114509/files/e76cec2d321817c0914b7693dc7c1fac98bdc67b
Lib/threading.pyhttps://github.com/python/cpython/pull/114509/files/e76cec2d321817c0914b7693dc7c1fac98bdc67b#diff-b250d3d0e0d909784a67083e9069ce507513a67e8514a011e2f364027e25e0b0
Please reload this pagehttps://github.com/python/cpython/pull/114509
aiskhttps://github.com/aisk
Feb 11, 2024 https://github.com/python/cpython/pull/114509#ref-commit-e7225f8
https://github.com/danielhollas
https://github.com/AlexWaygood
https://github.com/aisk
pythongh-109653https://github.com/python/cpython/issues/109653
: Speedup import of threading module (https://github.com/aisk/cpython/commit/e7225f833ac6176218ca9ad93c2c002f4542ba7c
python#114509https://github.com/python/cpython/pull/114509
)https://github.com/aisk/cpython/commit/e7225f833ac6176218ca9ad93c2c002f4542ba7c
e7225f8https://github.com/aisk/cpython/commit/e7225f833ac6176218ca9ad93c2c002f4542ba7c
https://github.com/danielhollas
danielhollashttps://github.com/danielhollas
Apr 27, 2025 https://github.com/python/cpython/pull/114509#ref-pullrequest-3023318012
gh-118761: Add test_lazy_import for more modules #133057 https://github.com/python/cpython/pull/133057
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%2F114509
https://github.com/ericsnowcurrently
ericsnowcurrently https://github.com/ericsnowcurrently
https://github.com/python/cpython/pull/114509/files/e76cec2d321817c0914b7693dc7c1fac98bdc67b
https://github.com/AlexWaygood
AlexWaygood https://github.com/AlexWaygood
https://github.com/python/cpython/pull/114509/files/e76cec2d321817c0914b7693dc7c1fac98bdc67b
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
Please reload this pagehttps://github.com/python/cpython/pull/114509
https://github.com/danielhollas
https://github.com/ajoino
https://github.com/AlexWaygood
https://github.com/ericsnowcurrently
https://github.com/Eclips4
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.