Title: Investigate making JSDoc parsing lazier and more optimal · Issue #52959 · microsoft/TypeScript · GitHub
Open Graph Title: Investigate making JSDoc parsing lazier and more optimal · Issue #52959 · microsoft/TypeScript
X Title: Investigate making JSDoc parsing lazier and more optimal · Issue #52959 · microsoft/TypeScript
Description: Not parsing JSDoc seems to unlock significant parsing wins. Surprisingly, we parse JSDoc unconditionally, even in .ts files for batch compilation. So there are a few things I want to investigate here: Can we optimize JSDoc parsing itself...
Open Graph Description: Not parsing JSDoc seems to unlock significant parsing wins. Surprisingly, we parse JSDoc unconditionally, even in .ts files for batch compilation. So there are a few things I want to investigate he...
X Description: Not parsing JSDoc seems to unlock significant parsing wins. Surprisingly, we parse JSDoc unconditionally, even in .ts files for batch compilation. So there are a few things I want to investigate he...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/52959
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Investigate making JSDoc parsing lazier and more optimal","articleBody":"[Not parsing JSDoc seems to unlock **significant** parsing wins.](https://github.com/microsoft/TypeScript/pull/52466#issuecomment-1407035947)\r\n\r\nSurprisingly, we parse JSDoc unconditionally, even in `.ts` files for batch compilation.\r\n\r\nSo there are a few things I want to investigate here:\r\n\r\n1. Can we optimize JSDoc parsing itself? Why is JSDoc parsing so slow in the first place? Even if we decided to always parse JSDoc comments, it should be fast because full time-to-interactivity in the language service is bottle-necked on parse time.\r\n\r\n My naive theory is that JSDoc scanning today is \"chatty\", returning uninteresting tokens, making every request for the next token unnecessarily slow. But of course, this is without benchmarking. I would love to understand what exactly is the issue here.\r\n2. If it's not strictly required, can we make JSDoc parse in a lazier or optional fashion? It seems unavoidable in JavaScript files; but maybe in TypeScript files, JSDoc is only attempted to be attached in cases where we detect that trivia intersects with tag names we're interested in (e.g. `@deprecated`, `@see`, `@link`, maybe more). Maybe we only do this for the language service.","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2023-02-25T00:15:57Z","url":"https://github.com/microsoft/TypeScript/issues/52959"}
| 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:766bf2c0-3b95-e5a0-413a-b571b3b29d00 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B134:2454CC:ABFBB4:DBDC65:6B00F71B |
| html-safe-nonce | 6adf2d0e215b3cae263ef1475c527f176da376a6d91054ffbe3bba7f718729d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTM0OjI0NTRDQzpBQkZCQjQ6REJEQzY1OjZCMDBGNzFCIiwidmlzaXRvcl9pZCI6IjEyNzkwNDEyMjgxODQyODcwMDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 960f67e4989e74905d414024e76d5919061ba41919b7427e2757c855a0389b3a |
| hovercard-subject-tag | issue:1599434681 |
| 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/microsoft/TypeScript/52959/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0faa46412bcaa446d46e547e4bd57f856bd0ff819eb10d5217ef00c5f049ca07/microsoft/TypeScript/issues/52959 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0faa46412bcaa446d46e547e4bd57f856bd0ff819eb10d5217ef00c5f049ca07/microsoft/TypeScript/issues/52959 |
| og:image:alt | Not parsing JSDoc seems to unlock significant parsing wins. Surprisingly, we parse JSDoc unconditionally, even in .ts files for batch compilation. So there are a few things I want to investigate he... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width