Title: TypeScript slow to respond when switching between projects · Issue #34843 · microsoft/TypeScript · GitHub
Open Graph Title: TypeScript slow to respond when switching between projects · Issue #34843 · microsoft/TypeScript
X Title: TypeScript slow to respond when switching between projects · Issue #34843 · microsoft/TypeScript
Description: Issue Type: Performance Issue For Kibana, we have a TypeScript setup with nested tsconfig.json files. Over the course of the last few months, I and others have started seeing serious latency (10s+) when resolving type information (either...
Open Graph Description: Issue Type: Performance Issue For Kibana, we have a TypeScript setup with nested tsconfig.json files. Over the course of the last few months, I and others have started seeing serious latency (10s+)...
X Description: Issue Type: Performance Issue For Kibana, we have a TypeScript setup with nested tsconfig.json files. Over the course of the last few months, I and others have started seeing serious latency (10s+)...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/34843
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeScript slow to respond when switching between projects","articleBody":"\r\nIssue Type: \u003cb>Performance Issue\u003c/b>\r\n\r\nFor [Kibana](https://github.com/elastic/kibana), we have a TypeScript setup with nested `tsconfig.json` files. Over the course of the last few months, I and others have started seeing serious latency (10s+) when resolving type information (either via suggestions or code navigation). We've also tried the same setup in Webstorm, and after some initial delay due to indexing, feedback from TypeScript is almost instant in WS.\r\n\r\nOur setup (where `./` is the root directory of the Kibana repo):\r\n- `./tsconfig.json`: type checks `./src/**/*`\r\n- `./x-pack/tsconfig.json`: extends the root `tsconfig.json` and type checks `./x-pack/**/*`\r\n- We use yarn workspaces, so npm modules can be resolved from both `./node_modules` and `./x-pack/node_modules`\r\n\r\nThe latency issues I have been experiencing are mostly when I'm working on a file that belongs to the `x-pack` project, and I want to resolve type information for an npm module. \"Local\" files are pretty fast to respond with type information (sub-second), but for npm modules, feedback consistently takes around 10 seconds. I've inspected the logs, and seemingly the delay happens because every time type information for an npm module is requested, the TypeScript service starts the root project, and closes it again after the tab is closed. I've taken the following steps to reproduce the issue:\r\n\r\n- Check out https://github.com/elastic/kibana/commit/e14dcb2afd1357a95a017795a773dbaa9a5aeb9f (this was the most recent commit when I reproduced the issue)\r\n- Run `yarn kbn:bootstrap` in the root of the directory\r\n- Open the Kibana repo in VS Code\r\n- Open `x-pack/legacy/plugins/apm/public/components/shared/ApmHeader/index.tsx`\r\n- Observe that it takes around 30s for the TypeScript server to start responding with type information\r\n- Open `x-pack/legacy/plugins/apm/public/components/shared/ApmHeader/DatePicker/index.tsx` via the import statement.\r\n- Observe that the file is opened (near-)instantly.\r\n- Open `react` from `DatePicker/index.tsx`, again via the import statement\r\n- Observe that the spinner (\"Initializing TS/JS language features\") starts\r\n- Observe that it takes around 10s for the file (`node_modules/@types/react/index.d.ts`) to open\r\n\r\nIt's important to note that this doesn't seem to happen once, but _every time type information from the inactive project is needed_. That means that initially, type info for `DatePicker` is instant, but is delayed for `react`. After hovering over `react`, type information for `DatePicker` is suddenly delayed. \r\n\r\nI've experimented with splitting up the two projects into smaller ones which seems to resolve the issue ([PR here](https://github.com/elastic/kibana/pull/48965)), but maybe it's possible that it could be fixed in VS Code as well. I'm optimistic that this is possible given the fact that Webstorm _can_ display instant feedback.\r\n\r\nLogs:\r\n[ts-logs.txt](https://github.com/microsoft/vscode/files/3763977/ts-logs.txt)\r\n \r\n\r\nVS Code version: Code 1.39.2 (6ab598523be7a800d7f3eb4d92d7ab9a66069390, 2019-10-15T15:33:00.827Z)\r\nOS version: Darwin x64 18.7.0\r\n\r\n\u003cdetails>\r\n\u003csummary>System Info\u003c/summary>\r\n\r\n|Item|Value|\r\n|---|---|\r\n|CPUs|Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz (12 x 2900)|\r\n|GPU Status|2d_canvas: enabled\u003cbr>flash_3d: enabled\u003cbr>flash_stage3d: enabled\u003cbr>flash_stage3d_baseline: enabled\u003cbr>gpu_compositing: enabled\u003cbr>multiple_raster_threads: enabled_on\u003cbr>native_gpu_memory_buffers: enabled\u003cbr>oop_rasterization: disabled_off\u003cbr>protected_video_decode: unavailable_off\u003cbr>rasterization: enabled\u003cbr>skia_deferred_display_list: disabled_off\u003cbr>skia_renderer: disabled_off\u003cbr>surface_synchronization: enabled_on\u003cbr>video_decode: enabled\u003cbr>viz_display_compositor: disabled_off\u003cbr>webgl: enabled\u003cbr>webgl2: enabled|\r\n|Load (avg)|2, 2, 2|\r\n|Memory (System)|32.00GB (7.88GB free)|\r\n|Process Argv||\r\n|Screen Reader|no|\r\n|VM|0%|\r\n\u003c/details>\u003cdetails>\r\n\u003csummary>Process Info\u003c/summary>\r\n\r\n```\r\nCPU %\tMem MB\t PID\tProcess\r\n 14\t 164\t 47107\tcode main\r\n 5\t 98\t 47108\t gpu-process\r\n 5\t 98\t 47498\t shared-process\r\n```\r\n\r\n\u003c/details>\r\n\u003cdetails>\r\n\u003csummary>Workspace Info\u003c/summary>\r\n\r\n```\r\n| Window (index.tsx — kibana-backup)\r\n| Folder (kibana-backup): more than 24161 files\r\n| File types: js(5297) ts(5054) md(949) tsx(887) json(634) scss(579)\r\n| png(435) map(347) asciidoc(302) snap(202)\r\n| Conf files: package.json(98) tsconfig.json(36) webpack.config.js(4)\r\n| grunt.js(2) settings.json(1) gulp.js(1)\r\n| jsconfig.json(1);\r\n```\r\n\r\n\u003c/details>\r\nExtensions: none\r\n\u003c!-- generated by issue reporter -->","author":{"url":"https://github.com/dgieselaar","@type":"Person","name":"dgieselaar"},"datePublished":"2019-10-23T19:19:45Z","url":"https://github.com/microsoft/TypeScript/issues/34843"}
| 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:59393d18-d88d-9b3e-a89e-320835ad1239 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D46E:3D97C8:A01647:D76C2B:6B00EBD5 |
| html-safe-nonce | 4dafc1f86623b3b66ace17014544eb378245041e10a05d40e1487e23f1b40d54 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDZFOjNEOTdDODpBMDE2NDc6RDc2QzJCOjZCMDBFQkQ1IiwidmlzaXRvcl9pZCI6Ijg3ODU2MzEzOTQyMDMyMzMyMzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6dcb6471146b788d7dfcb0b00100cead0dfc943f240575fd423de5fc1caf4785 |
| hovercard-subject-tag | issue:515075647 |
| 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/34843/issue_layout |
| twitter:image | https://opengraph.githubassets.com/34b38e48c8eb65ef85b47c1c86c37af53f13fcf6e48b4bc818d6eac6155c130f/microsoft/TypeScript/issues/34843 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/34b38e48c8eb65ef85b47c1c86c37af53f13fcf6e48b4bc818d6eac6155c130f/microsoft/TypeScript/issues/34843 |
| og:image:alt | Issue Type: Performance Issue For Kibana, we have a TypeScript setup with nested tsconfig.json files. Over the course of the last few months, I and others have started seeing serious latency (10s+)... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dgieselaar |
| 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