Title: gh-118761: Optimise import time for ast by AA-Turner · Pull Request #131953 · python/cpython · GitHub
Open Graph Title: gh-118761: Optimise import time for ast by AA-Turner · Pull Request #131953 · python/cpython
X Title: gh-118761: Optimise import time for ast by AA-Turner · Pull Request #131953 · python/cpython
Description: Attempting @JelleZijlstra's suggestion in #118761 (comment). Running python -Ximporttime -Sc "import ast" ten times with the current and proposed modules, I get 14.1ms for the current module and 1.48ms for the new, for a ~12ms speed up. I've left numbers out of the NEWS entry for now, as I've only tested on a Windows PC -- Linux may have different performance profiles. Full Times (using the last line of each output) Current import time: self [us] | cumulative | imported package import time: 1277 | 13904 | ast import time: 1363 | 14813 | ast import time: 1343 | 14246 | ast import time: 1330 | 14280 | ast import time: 1387 | 13974 | ast import time: 1373 | 13837 | ast import time: 1345 | 14456 | ast import time: 1349 | 14050 | ast import time: 1322 | 14226 | ast import time: 1246 | 13444 | ast Proposed import time: 455 | 1338 | ast import time: 457 | 1387 | ast import time: 476 | 1470 | ast import time: 459 | 1474 | ast import time: 493 | 1480 | ast import time: 499 | 1458 | ast import time: 448 | 1513 | ast import time: 492 | 1501 | ast import time: 487 | 1515 | ast import time: 602 | 1688 | ast Issue: gh-118761
Open Graph Description: Attempting @JelleZijlstra's suggestion in #118761 (comment). Running python -Ximporttime -Sc "import ast" ten times with the current and proposed modules, I get 14.1ms for the curren...
X Description: Attempting @JelleZijlstra's suggestion in #118761 (comment). Running python -Ximporttime -Sc "import ast" ten times with the current and proposed modules, I get 14.1ms fo...
Opengraph URL: https://github.com/python/cpython/pull/131953
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/commits/:range(.:format) |
| route-controller | pull_requests |
| route-action | commits |
| fetch-nonce | v2:f060579f-a96e-6db0-fea7-ce62f7da9281 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 930A:22FFB1:DF5B39:12A4EFF:6994F988 |
| html-safe-nonce | 44e98560ce6c125d79a9f517fccf5d7b20f60a79d49c16ec46b7403498ac5fef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzBBOjIyRkZCMTpERjVCMzk6MTJBNEVGRjo2OTk0Rjk4OCIsInZpc2l0b3JfaWQiOiIxNDI0NjQ0MTY3MTM3ODE5MDE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 86cb9f3ed312d0f338fe7e701d3ee7a44b4462359a093c706fb3fb3c2fa6c62b |
| hovercard-subject-tag | pull_request:2429625247 |
| 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/131953/commits/dc95d19556bf741572286c9402265a4e6949219d |
| 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 | Attempting @JelleZijlstra's suggestion in #118761 (comment). Running python -Ximporttime -Sc "import ast" ten times with the current and proposed modules, I get 14.1ms for the curren... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4bd759bc5f83244e2a0de29b937365905c0fefd238b6f077c24a49830375b4df |
| 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 | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2616d2b216d6e9d52f595f6aaf832bb7a377b236 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width