ember-cli: The 'tmp' folder in the project root causes the typescript compiler to consume 100% cpu
We use ember-cli-typescript to compile our typescript source files. As described in https://github.com/typed-ember/ember-cli-typescript/pull/172, rebuilds can take a very long time. It is not only ember-cli-typescript that suffers from this performance issues, ‘Visual Studio Code’ has the same problem. It is bassically ‘tsc --watch’ that consumes 100% cpu.
Output from ember version --verbose && yarn --version:
ember-cli: 3.0.2
http_parser: 2.8.0
node: 8.11.1
v8: 6.2.414.50
uv: 1.19.1
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 57
nghttp2: 1.25.0
openssl: 1.0.2o
icu: 60.1
unicode: 10.0
cldr: 32.0
tz: 2017c
os: darwin x64
1.5.1
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (12 by maintainers)
@bartocc and others: the
jsconfig.jsonandtsconfig.jsonfiles don’t have quite the effect they might seem to. It turns out they don’t disable the TS language server—which VS Code uses under the hood to power a lot of its smarts even for JS—watching those directories, they just keep it from processing them. (This has come up repeatedly for TS Ember users, and it’s a major point of annoyance.)The actual solution—which is also applicable to Sublime Text, if I recall correctly, and may be applicable to Atom as well—is to go at it from the editor settings. You can either generally exclude those directories, or you can do it in a per-workspace settings which you commit. It’ll end up in
.vscode/settings.jsonin your directory.As an example, here is the relevant part of my
.vscode/settings.jsonin the Ember app I work on right now:This is definitely a bandaid, but it gets the job done until we get the final fix in. Note: all of these are useful, but it’s specifically the
"files.watcherExclude"key that keeps the TS server from blowing up, as far as we can tell.@jenweber flagging this up for you as a thing we might want to include docs somewhere; I can open an issue and indeed a PR if you can point me to the place the learning team thinks is the best fit for this info.
A large step forward on moving
tmpout of the project landed yesterday in https://github.com/ember-cli/ember-cli/pull/7798. At the moment, you can try this out by using the master branch ofember-cliand running:I am unsure if there is a more specific tracking issue for enabling those two experiments by default…
Yep, totally agree! We are working towards moving
tmpto the default system tmp folder location.thx a lot @rwjblue for pointing us to those feature flags!
@chriskrycho, I recall trying some of those configs, but at that time I had not clearly identified the tsserver issue. I’ll try again and see how it affects the CPU issue. Thx!