Title: gh-118761: Improve import time of `tomllib` by hukkin · Pull Request #128907 · python/cpython · GitHub
Open Graph Title: gh-118761: Improve import time of `tomllib` by hukkin · Pull Request #128907 · python/cpython
X Title: gh-118761: Improve import time of `tomllib` by hukkin · Pull Request #128907 · python/cpython
Description: This is a port of two commits in Tomli repository (the diff of these commits being hukkin/tomli@42a570d...1da01ef). This removes runtime overhead of string, typing, and tomllib._types imports from import tomllib. main branch $ hyperfine --warmup 8 "./python -c 'import tomllib'" "./python -c 'pass'" Benchmark 1: ./python -c 'import tomllib' Time (mean ± σ): 70.3 ms ± 1.8 ms [User: 66.0 ms, System: 4.3 ms] Range (min … max): 68.6 ms … 76.8 ms 41 runs Benchmark 2: ./python -c 'pass' Time (mean ± σ): 26.2 ms ± 0.7 ms [User: 23.3 ms, System: 3.0 ms] Range (min … max): 25.1 ms … 29.7 ms 110 runs Summary './python -c 'pass'' ran 2.69 ± 0.10 times faster than './python -c 'import tomllib'' PR branch $ hyperfine --warmup 8 "./python -c 'import tomllib'" "./python -c 'pass'" Benchmark 1: ./python -c 'import tomllib' Time (mean ± σ): 48.0 ms ± 0.7 ms [User: 43.4 ms, System: 4.7 ms] Range (min … max): 46.8 ms … 50.2 ms 60 runs Benchmark 2: ./python -c 'pass' Time (mean ± σ): 26.1 ms ± 0.4 ms [User: 23.5 ms, System: 2.7 ms] Range (min … max): 25.3 ms … 27.4 ms 110 runs Summary './python -c 'pass'' ran 1.84 ± 0.04 times faster than './python -c 'import tomllib'' Issue: gh-118761
Open Graph Description: This is a port of two commits in Tomli repository (the diff of these commits being hukkin/tomli@42a570d...1da01ef). This removes runtime overhead of string, typing, and tomllib._types imports from ...
X Description: This is a port of two commits in Tomli repository (the diff of these commits being hukkin/tomli@42a570d...1da01ef). This removes runtime overhead of string, typing, and tomllib._types imports from ...
Opengraph URL: https://github.com/python/cpython/pull/128907
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7b3dbd58-f3c8-f130-1154-0884694649be |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CB94:10A5B6:380C9E:4C5971:6969CF10 |
| html-safe-nonce | 80fa82acfe3644c0e8706d04c7f99cfd006f6b5f9eb13b0a5995cf847b9e4bec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjk0OjEwQTVCNjozODBDOUU6NEM1OTcxOjY5NjlDRjEwIiwidmlzaXRvcl9pZCI6IjE2NTA4OTk2NTU1NTkwNzM1NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a141b2d915d0e035e3b3e8f9e9d40a4642f310661c6636cc4f45d792adef0c7a |
| hovercard-subject-tag | pull_request:2281229973 |
| 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/128907/files |
| twitter:image | https://avatars.githubusercontent.com/u/3275109?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3275109?s=400&v=4 |
| og:image:alt | This is a port of two commits in Tomli repository (the diff of these commits being hukkin/tomli@42a570d...1da01ef). This removes runtime overhead of string, typing, and tomllib._types imports from ... |
| 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