0

I am using TypeScript 2.2.1 and I am experiencing a long compilation time when doing tsc, so I added the --diagnostics hoping it can give me more information. However, I noticed the "Total time" reported is not accurate to the time I observed.

For example, when I run

$ date && tsc  --diagnostics && date
Wed, Mar 22, 2017  1:21:41 PM
Files:          200
Lines:        25865
Nodes:        91671
Identifiers:  30796
Symbols:      32727
Types:         8447
Memory used: 64572K
I/O read:     0.07s
I/O write:    0.02s
Parse time:   1.17s
Bind time:    0.30s
Check time:   0.97s
Emit time:    0.16s
Total time:   2.61s
Wed, Mar 22, 2017  1:22:52 PM

Since the start time was 1:21:41 PM and finish time was 1:22:52 PM, I was hoping the total time reported in tsc would be about ~1 min, but it was showing 2.61s which is not correct.

Is there a better way to trace the compilation time in tsc?

Anthony C
  • 2,117
  • 2
  • 15
  • 26
  • write a node module let it call tsc compiler & register it as scripts in package.json,then run it used as `npm run tsc` – holi-java Mar 22 '17 at 17:57

2 Answers2

0

I was hoping the total time reported in tsc would be about ~1 min, but it was showing 2.61s which is not correct.

Based on the time reported by tsc I suspect it's got nothing to do with tsc and simply the nodejs boot time.

Try time node somesimplefile.js and fix your node installation (reinstall / update) if its taking too long.

basarat
  • 261,912
  • 58
  • 460
  • 511
0

Not sure why, but we found out the long compilation time was due to this line in the tsconfig.json

"extends": "../tsconfig",

After removing it, the long compilation time was resolved.

Anthony C
  • 2,117
  • 2
  • 15
  • 26