Title: gh-118761: Always lazy import `re` in `locale` by donbarbos · Pull Request #129860 · python/cpython · GitHub
Open Graph Title: gh-118761: Always lazy import `re` in `locale` by donbarbos · Pull Request #129860 · python/cpython
X Title: gh-118761: Always lazy import `re` in `locale` by donbarbos · Pull Request #129860 · python/cpython
Description: Improve import time of locale by lazy import re CPython configure flags: ./configure --enable-optimizations --with-lto --enable-loadable-sqlite-extensions Benchmarks: Running: pipx install tuna && ./python -X importtime -c 'import locale' 2> import.log && tuna import.log Total import time: 0.014s -> 0.009s = x1.56 as fast main branch PR branch locale import time: 0.007s -> 0.003s = x2.34 as fast main branch PR branch hyperfine: 14.9ms -> 12.1ms = x1.23 as fast Main branch: $ hyperfine --warmup 11 --runs 3000 "./python -c 'import locale'" Benchmark 1: ./python -c 'import locale' Time (mean ± σ): 14.9 ms ± 0.5 ms [User: 12.8 ms, System: 2.1 ms] Range (min … max): 14.4 ms … 25.3 ms 3000 runs PR branch: $ hyperfine --warmup 11 --runs 3000 "./python -c 'import locale'" Benchmark 1: ./python -c 'import locale' Time (mean ± σ): 12.1 ms ± 0.5 ms [User: 10.0 ms, System: 2.1 ms] Range (min … max): 11.6 ms … 21.6 ms 3000 runs Issue: gh-118761
Open Graph Description: Improve import time of locale by lazy import re CPython configure flags: ./configure --enable-optimizations --with-lto --enable-loadable-sqlite-extensions Benchmarks: Running: pipx install tuna &am...
X Description: Improve import time of locale by lazy import re CPython configure flags: ./configure --enable-optimizations --with-lto --enable-loadable-sqlite-extensions Benchmarks: Running: pipx install tuna &am...
Opengraph URL: https://github.com/python/cpython/pull/129860
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:970048c9-e1c2-00e0-b61a-2eb50175fa6c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CE5C:339E6E:6F29C4:9438BE:6969B8B2 |
| html-safe-nonce | 047a9250a385bc8db2266a227a087ede29a2ac631e2bfd2afe27aa6b4a5fa51d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTVDOjMzOUU2RTo2RjI5QzQ6OTQzOEJFOjY5NjlCOEIyIiwidmlzaXRvcl9pZCI6IjU3NzQyNDUwODc4MTc2MTE0NDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b2737cc951dc6abe15ea1f163acdc34d96be16c2e222539bee8ebb2aea000752 |
| hovercard-subject-tag | pull_request:2324122119 |
| 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/129860/files |
| twitter:image | https://avatars.githubusercontent.com/u/47272787?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/47272787?s=400&v=4 |
| og:image:alt | Improve import time of locale by lazy import re CPython configure flags: ./configure --enable-optimizations --with-lto --enable-loadable-sqlite-extensions Benchmarks: Running: pipx install tuna &am... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| 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 | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width