Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.4.2
Expected behavior:
When I am not touching any files in my project, TSC with watch: true configured will not consume much (if any) CPU.
Actual behavior:
When I am not touching any files in my project, TSC with watch: true configured consumes a notable amount of CPU on my laptop, enough to keep the fan on consistently.
This blog post suggests that the culprit is a recent change to polling for changes.
Notes:
I am using VSCode with the built-in TypeScript support, the default TypeScript build task and a tsconfig.json like:
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"sourceMap": true,
"outDir": "output",
"rootDir": "source",
"paths": {
"*": [
"./typings/*"
]
},
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"strictNullChecks": true,
"alwaysStrict": true,
"allowJs": true,
"watch": true
}
}
Reacted by Nigel Jones
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Activity
NigeNigeNige commentedon Aug 2, 2017
I'm seeing something similar with tsc 2.3.4.
With polling enabled, tsc -w -p takes up 10-15% CPU on our project files.
With polling disabled, the same command uses virtually no CPU if no files are changing.
Windows 10, Core i5.
mhegazy commentedon Oct 4, 2017
Should be fixed in #17269. Please give typescript@next a try and let us know if you are still running into issues.