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/files/:range(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:81fd53ad-08b7-c75a-82d3-78c4cd285899 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8A28:2BECE7:11473E7:16C0F88:69969E5A |
| html-safe-nonce | 2beb6f8d6f4588cce4237473a48a9225c18f574aa4265fb0cf7c35e86eebaf7f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTI4OjJCRUNFNzoxMTQ3M0U3OjE2QzBGODg6Njk5NjlFNUEiLCJ2aXNpdG9yX2lkIjoiMTM4MTg3MDY0MzY3MTYzNzU5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 811df906715b5338d8194124f3e78f90544e1a6ea1511e124e6b7e2c6301bcac |
| 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/files/d88eb24b2e5c1e81ed393f604590304dfcc47002 |
| 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 | 5513290f8d09a9ed78de519ab8316ed23b2b0ddd5e91d2420df56691d00827e8 |
| 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 | 713df166b386c9c8deff3497f1bcf2b0591aa817 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width