tsc -w is unacceptably slow
I'm on windows. Typescript version installed via npm is 1.7.5. When I do tsc -w typescript watches for changes but its change detection is really slow. I takes about 10s before it notices I made a change and then recompiles.
What could be causing this?
Edit: Node 5.3.0
I have the same problem with 1.7.5 on Mac. In my case, it takes ~ 5 seconds before it notices that something changed.
What version of node are you using?
I'm using 5.2.0 but the same problem I had on 0.12.2. I have no problem withtsc -w in version 1.7.3.
Pinging @zhengbli and @vladima.
Just as a heads up everyone, you can go back to 1.7.3 with no user-facing issues. 1.7.5's only change was on file watching behavior which is what you're noticing.
FWIW, I see same problem (except even slower ~ 20s delay) on Linux w/ node 4.0.0. Still slow with current snapshot 1.8.0-dev.20151222
I tried 1.7.3 on 5.3.0/Win and it's only marginally better: 4-5s.
Same issue on Linux with node 0.10. Delay is about 4-5 seconds. Tried 1.7.5 and 1.7.3 - same result.
Here is tsconfig.json:
{
"compilerOptions": {
"target": "ES5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
"outDir": "./app"
},
"exclude": [
"node_modules"
]
}
Same 5s delay here (ver 1.7.5 and 1.5.3 before) on mac with following tsconfig:
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules"
]
}
Same issue 5 second delay node v4.1.0 on windows.
tsconfig.json :
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false
},
"exclude": [
"node_modules",
".git"
]
}
Same issue on linux, node 5.1.0. Fixed with 1.7.3.
Same issue on Mac OS X 10.11. Downgrading to 1.7.3 helps partially - sometimes the watcher fires fast, most of the time there's a big delay.
PR https://github.com/Microsoft/TypeScript/pull/6026 should address this issue. We should have this in shortly. sorry for the delay.
Thanks for the status update @mhegazy
Looking forward for th fix. This explains a slowdown I have in my angular 2 app using lite-server
I am having slow reload with typescript 1.7+, works fine with typescript 1.6.
Anybody else?
@asadsahi this change was introduced between TS 1.7.3 and TS 1.7.5, if you are running into issues with TS 1.7.3 then it is a different issue.
I am having same issue with typescript 1.7.3.
@asadsahi that is a different issue then. can you provide more details? how many files do you have? can you share your configurations?
I think it's still the same issue as many commenters pointed out. There's very little difference between 1.7.3 and 1.7.5 they're both slow compared to other watchers like gulp watch or webpack watch.
A fix was merged in master just now and will be published tomorrow via typescript@next on npm, so if anyone is willing to give it a shot it would be great. Thanks!