Title: tsc is very slow in subdirectories of larger project · Issue #36103 · microsoft/TypeScript · GitHub
Open Graph Title: tsc is very slow in subdirectories of larger project · Issue #36103 · microsoft/TypeScript
X Title: tsc is very slow in subdirectories of larger project · Issue #36103 · microsoft/TypeScript
Description: Maybe there's something unique to my system or my project going on here, but I'm getting very slow performance from tsc when trying to compile a single file from a subdirectory inside a larger project. The larger project is being compile...
Open Graph Description: Maybe there's something unique to my system or my project going on here, but I'm getting very slow performance from tsc when trying to compile a single file from a subdirectory inside a larger proj...
X Description: Maybe there's something unique to my system or my project going on here, but I'm getting very slow performance from tsc when trying to compile a single file from a subdirectory inside a lar...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/36103
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tsc is very slow in subdirectories of larger project","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n-->\r\n\r\nMaybe there's something unique to my system or my project going on here, but I'm getting very slow performance from `tsc` when trying to compile a single file from a subdirectory inside a larger project. The larger project is being compiled with parcel and is not using a .tsconfig file right now. I can demonstrate with a trivial example, see code below.\r\n\r\n\u003c!--\r\nPlease try to reproduce the issue with the latest published version. It may have already been fixed.\r\nFor npm: `typescript@next`\r\nThis is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly\r\n-->\r\n**TypeScript Version:**\r\nVersion 3.8.0-dev.20200109, 3.7, 3.1 for comparison. All had the same issue.\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:**\r\ntsc, typescript compiler very slow in subdirectories, scanning files outside of root, unused files\r\n\r\n**Code**\r\n```bash\r\n~/somepath/lib/sound echo \"var s: string = 'hello';\" > hello.ts\r\n~/somepath/lib/sound time tsc hello.ts\r\n\r\nreal\t0m5.592s # \u003c-- very slow\r\nuser\t0m9.604s\r\nsys\t0m0.473s\r\n~/somepath/lib/sound cp hello.ts /tmp/tstmp/\r\n~/somepath/lib/sound pushd /tmp/tstmp/\r\n/tmp/tstmp ls\r\nhello.ts\r\n/tmp/tstmp time tsc hello.ts\r\n\r\nreal\t0m1.916s # \u003c-- less slow\r\nuser\t0m3.089s\r\nsys\t0m0.187s\r\n```\r\n\r\n**Expected behavior:**\r\nCompiler should not take >5 seconds for a trivial compilation, and should only look at files referenced by the entry file.\r\n\r\n**Actual behavior:**\r\nWhen compiling a single trivial file (or even trying to compile a file that does not exist) from a subdirectory within a larger project, the compilation took over 5 seconds, vs \u003c2 in a clean directory. But even the 2 seconds for a trivial compilation seems quite slow.\r\n\r\n**Related Issues:** \u003c!-- Did you find other bugs that looked similar? -->\r\nLots of issues refer to slow compilation, but I did not find any describing this specific problem. \r\n","author":{"url":"https://github.com/bgmort","@type":"Person","name":"bgmort"},"datePublished":"2020-01-09T21:25:21Z","url":"https://github.com/microsoft/TypeScript/issues/36103"}
| 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:e0b72581-1308-8cae-af4a-2b8ee7fcbe8b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EDFA:2463BD:300F40B:3D64629:6B01BC03 |
| html-safe-nonce | ee8ef5161e174b6446bd8fd766d22841417256272ee947d5fad7092bf28b5dc8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFREZBOjI0NjNCRDozMDBGNDBCOjNENjQ2Mjk6NkIwMUJDMDMiLCJ2aXNpdG9yX2lkIjoiODQxNjQzMTcxODAzOTM3Nzk1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f14151a236cf14bbbdfdf92b69df8e8799ae7e797a5cca34d76c332110acb735 |
| hovercard-subject-tag | issue:547732203 |
| 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/36103/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2d222a6e6ebd160da299979322ccb3e24ed3bc8e299d9efd841c23b67211563a/microsoft/TypeScript/issues/36103 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2d222a6e6ebd160da299979322ccb3e24ed3bc8e299d9efd841c23b67211563a/microsoft/TypeScript/issues/36103 |
| og:image:alt | Maybe there's something unique to my system or my project going on here, but I'm getting very slow performance from tsc when trying to compile a single file from a subdirectory inside a larger proj... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bgmort |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width