Title: gh-109653: Fix py312 regression in the import time of `random` by AlexWaygood · Pull Request #110221 · python/cpython · GitHub
Open Graph Title: gh-109653: Fix py312 regression in the import time of `random` by AlexWaygood · Pull Request #110221 · python/cpython
X Title: gh-109653: Fix py312 regression in the import time of `random` by AlexWaygood · Pull Request #110221 · python/cpython
Description: As an optimisation to reduce the import time of the module, random first tries to import sha512 from the internal _sha512 module before falling back to hashlib. The problem, however, is that Python no longer has a _sha512 module! It was removed in 0b13575, by @gpshead. That means we're currently always falling back to the slow path in random.py, leading to the import time of random being far slower than it should be. Importing sha512 from the correct module in the fast path cuts 60% off the import time of random. Issue: gh-109653
Open Graph Description: As an optimisation to reduce the import time of the module, random first tries to import sha512 from the internal _sha512 module before falling back to hashlib. The problem, however, is that Python...
X Description: As an optimisation to reduce the import time of the module, random first tries to import sha512 from the internal _sha512 module before falling back to hashlib. The problem, however, is that Python...
Opengraph URL: https://github.com/python/cpython/pull/110221
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:062e1a9a-5538-4abc-60a0-6eed96363039 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9B44:356387:C334DC:FD5D64:696B271B |
| html-safe-nonce | bfd8df5e2fb0ebff9762ba838f64ac6857a7e6bea8af35dc0f38ba71eb9a822f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjQ0OjM1NjM4NzpDMzM0REM6RkQ1RDY0OjY5NkIyNzFCIiwidmlzaXRvcl9pZCI6IjE2NjMwNjUzMDkzMzg4NzE1NzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c92909f6cc0206391267820ac4bb4bd623382c2b437bff7adb7dbf1fe768f34b |
| hovercard-subject-tag | pull_request:1538149629 |
| 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/110221/files |
| twitter:image | https://avatars.githubusercontent.com/u/66076021?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/66076021?s=400&v=4 |
| og:image:alt | As an optimisation to reduce the import time of the module, random first tries to import sha512 from the internal _sha512 module before falling back to hashlib. The problem, however, is that Python... |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width