Description
openedon Jan 17, 2018
This problem is killing us. Our TS node project started being mind-bogglingly slow since a few days ago and it's hindering our work. I found out as long as I have no @types\*
modules installed, it works fine but as soon as I add any @types
module, such as @types/bluebird
it gets slow.
When all type modules are removed, tsc
takes about 5 sec to complete (obviously with a lot of errors). With type modules installed, it takes about 30 sec and with typescript@next is it about twice as slow.
Here are the diagnostics stats:
tsc version 2.6.2
Files: 227
Lines: 140932
Nodes: 569637
Identifiers: 209088
Symbols: 1071525
Types: 849139
Memory used: 906107K
I/O read: 0.02s
I/O write: 0.02s
Parse time: 1.82s
Bind time: 0.68s
Check time: 26.49s
Emit time: 1.77s
Total time: 30.76s
tsc version 2.7.0-dev.20180116
Files: 228
Lines: 141263
Nodes: 571047
Identifiers: 209620
Symbols: 2169856
Types: 1077202
Memory used: 1156922K
I/O read: 0.04s
I/O write: 0.03s
Parse time: 1.81s
Bind time: 0.67s
Check time: 51.69s
Emit time: 2.20s
Total time: 56.36s
Here are the type modules that we use:
npm install @types/bluebird @types/body-parser @types/bunyan @types/chai @types/continuation-local-storage @types/cookie-parser @types/download @types/express @types/express-serve-static-core @types/form-data @types/geojson @types/googlemaps @types/lodash @types/long @types/mime @types/moment-timezone @types/morgan @types/nconf @types/node @types/node-geocoder @types/query-string @types/reflect-metadata @types/request @types/request-promise @types/sequelize @types/serve-static @types/stripe @types/twilio @types/validator --save-dev
Also in VSCode, CMD+Click on symbols takes a long time to resolve and when running TS Build Task sometimes we get this error:
CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Do you have any suggestions how we can fix this problem?