Title: gh-118761: Optimise import time for ``string`` by AA-Turner · Pull Request #132037 · python/cpython · GitHub
Open Graph Title: gh-118761: Optimise import time for ``string`` by AA-Turner · Pull Request #132037 · python/cpython
X Title: gh-118761: Optimise import time for ``string`` by AA-Turner · Pull Request #132037 · python/cpython
Description: This PR achieves a 27x improvement in import time for the string module. The main improvement comes from replacing Template.__init_subclass__() (GH-16256) with a descriptor class, allowing lazy import of the re module. Current: import string: cumulative time mean: 9162.100 µs median: 9133.000 µs stdev: 66.662 min: 9071 max: 9301 This PR: import string: cumulative time mean: 334.967 µs median: 329.000 µs stdev: 13.438 min: 316 max: 368 Issue: gh-118761
Open Graph Description: This PR achieves a 27x improvement in import time for the string module. The main improvement comes from replacing Template.__init_subclass__() (GH-16256) with a descriptor class, allowing lazy imp...
X Description: This PR achieves a 27x improvement in import time for the string module. The main improvement comes from replacing Template.__init_subclass__() (GH-16256) with a descriptor class, allowing lazy imp...
Opengraph URL: https://github.com/python/cpython/pull/132037
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:ef6bd977-42a6-88bc-5a64-f98555bc781a |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | CFF0:9D4F4:8E5DBF:C28E26:6969DF7C |
| html-safe-nonce | e60c9954227d0d8efc9c987efe92c3bc06a743c6cede5360be7c6e947f045f67 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkYwOjlENEY0OjhFNURCRjpDMjhFMjY6Njk2OURGN0MiLCJ2aXNpdG9yX2lkIjoiMjIxOTIzOTQ5MjI4OTE1OTAzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 47c5c4fcf9ceec40d7a8e0f084821a44dbeb1b6190fa0ab74daf99a9b4108b5b |
| hovercard-subject-tag | pull_request:2435529213 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/132037/checks |
| twitter:image | https://avatars.githubusercontent.com/u/9087854?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/9087854?s=400&v=4 |
| og:image:alt | This PR achieves a 27x improvement in import time for the string module. The main improvement comes from replacing Template.__init_subclass__() (GH-16256) with a descriptor class, allowing lazy imp... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-cache |
| 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 full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width