Title: Faster cache deserialization · Issue #3456 · python/mypy · GitHub
Open Graph Title: Faster cache deserialization · Issue #3456 · python/mypy
X Title: Faster cache deserialization · Issue #3456 · python/mypy
Description: Deserialization of cache files is a major bottleneck in incremental mode, so any performance improvements there would be valuable. At least @pkch has previously worked on this, and it's unclear if any significant wins are achievable with...
Open Graph Description: Deserialization of cache files is a major bottleneck in incremental mode, so any performance improvements there would be valuable. At least @pkch has previously worked on this, and it's unclear if ...
X Description: Deserialization of cache files is a major bottleneck in incremental mode, so any performance improvements there would be valuable. At least @pkch has previously worked on this, and it's unclear...
Opengraph URL: https://github.com/python/mypy/issues/3456
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Faster cache deserialization","articleBody":"Deserialization of cache files is a major bottleneck in incremental mode, so any performance improvements there would be valuable. \r\n\r\nAt least @pkch has previously worked on this, and it's unclear if any significant wins are achievable without a lot of work. However, there seem to be some redundant information in the cache files that we haven't looked at eliminating yet. \r\n\r\nHere are some random ideas:\r\n\r\n* Use shared type objects at least for common types such as `int` and `str`.\r\n* Don't include default attribute values for the most common AST nodes. For example, we could have `\"defaults\": true` to mark that we can skip processing non-default values altogether.\r\n* Use shared dummy objects for things like empty function bodies.\r\n* Micro-optimize deserialization of the most common node types.\r\n* Avoid repeating information about arguments in the serialized form of FuncDefs.\r\n\r\nIdea for how to move forward:\r\n\r\n* Run a profiling run when type checking mypy and looks for promising hot spots (spoiler: there probably aren't any major hot spots visible in the profile). Post results here.\r\n* Determine which node types are the most common ones during deserialization. Also calculate cumulative figures and percentages (of all nodes). Post results here.\r\n* Prototype various potential optimizations and benchmark them individually. Note that getting reliable benchmark results is hard because of turbo modes, background processes, etc. I may look at setting up a dedicated system for running benchmarks.\r\n* If speedups from individual optimizations are negligible (under 0.5%) or negative, give up on them and post the negative results here. Otherwise we risk others doing the same experiment in the future.\r\n* If the total speedup from all optimizations would be under, say, 10%, it probably doesn't make sense to land any of them, unless some optimizations are utterly trivial.\r\n\r\nIn any case, this issue isn't important enough to spend a lot of time on it. We have other plans to speed up mypy, but as they will take more effort, so some quick wins here would be nice.","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2017-05-26T16:22:41Z","url":"https://github.com/python/mypy/issues/3456"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ba5ce81b-510e-9f2d-c2f4-278e41562d88 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEF6:2573D7:218E702:2DB93E6:6B00255C |
| html-safe-nonce | 307119ee0d9e97b7ff3ffbb7aac092f3b312a14db28e410297509914b42bc0f8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUY2OjI1NzNENzoyMThFNzAyOjJEQjkzRTY6NkIwMDI1NUMiLCJ2aXNpdG9yX2lkIjoiNzczNDAzMDk3NzAxNzU4NzAzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 56d6db9ea9608beafa77b2c011f8363422b18e6262bb0fdd2b1cd67d441de18b |
| hovercard-subject-tag | issue:231673453 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/mypy/3456/issue_layout |
| twitter:image | https://opengraph.githubassets.com/24c82917cd5a16416548bbe2fdc6c7eb0688a16f2146d1b68ba83abc8a84a531/python/mypy/issues/3456 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/24c82917cd5a16416548bbe2fdc6c7eb0688a16f2146d1b68ba83abc8a84a531/python/mypy/issues/3456 |
| og:image:alt | Deserialization of cache files is a major bottleneck in incremental mode, so any performance improvements there would be valuable. At least @pkch has previously worked on this, and it's unclear if ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width