Title: gh-109653: Improve import time of `logging` by lazy loading `traceback` by danielhollas · Pull Request #112995 · python/cpython · GitHub
Open Graph Title: gh-109653: Improve import time of `logging` by lazy loading `traceback` by danielhollas · Pull Request #112995 · python/cpython
X Title: gh-109653: Improve import time of `logging` by lazy loading `traceback` by danielhollas · Pull Request #112995 · python/cpython
Description: Lazy importing traceback module in logging improves the import time by ~15% on my machine (PGO-optimized build on Linux). Since traceback is used here to handle exceptions, these code paths should by definition better be exceptional so lazy loading makes sense. In order to avoid performance impacts, I have used a trick proposed in a similar PR. Perhaps this trick is not necessary here though since as mentioned above these code paths should not be hot. TODO: Fix the failing test. Issue: gh-109653
Open Graph Description: Lazy importing traceback module in logging improves the import time by ~15% on my machine (PGO-optimized build on Linux). Since traceback is used here to handle exceptions, these code paths should ...
X Description: Lazy importing traceback module in logging improves the import time by ~15% on my machine (PGO-optimized build on Linux). Since traceback is used here to handle exceptions, these code paths should ...
Opengraph URL: https://github.com/python/cpython/pull/112995
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e18aa4fe-8cac-f91b-fdfe-710c186ec4ef |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D5E6:1DECF9:13DB683:19EC498:696B1B2E |
| html-safe-nonce | 98c68785e78356ad5b84cc5defe0da6b796bb3efba68a69eec75f9b867f7554e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUU2OjFERUNGOToxM0RCNjgzOjE5RUM0OTg6Njk2QjFCMkUiLCJ2aXNpdG9yX2lkIjoiODM2ODAyNzU1MzU3MzMxMzMyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e6e137c170c93059bc9493994a14a7ba792259545859b3b2f2d49e0d71d7c014 |
| hovercard-subject-tag | pull_request:1640273502 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/112995/files |
| twitter:image | https://avatars.githubusercontent.com/u/9539441?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/9539441?s=400&v=4 |
| og:image:alt | Lazy importing traceback module in logging improves the import time by ~15% on my machine (PGO-optimized build on Linux). Since traceback is used here to handle exceptions, these code paths should ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width