@@ -322,6 +322,7 @@ module ts {
322
322
}
323
323
324
324
function compile ( fileNames : string [ ] , compilerOptions : CompilerOptions , compilerHost : CompilerHost ) {
325
+ ts . ioReadTime = 0 ;
325
326
ts . parseTime = 0 ;
326
327
ts . bindTime = 0 ;
327
328
ts . checkTime = 0 ;
@@ -330,9 +331,12 @@ module ts {
330
331
var start = new Date ( ) . getTime ( ) ;
331
332
332
333
var program = createProgram ( fileNames , compilerOptions , compilerHost ) ;
334
+ var programTime = new Date ( ) . getTime ( ) - start ;
335
+
333
336
var exitStatus = compileProgram ( ) ;
334
337
335
338
var end = new Date ( ) . getTime ( ) - start ;
339
+ var compileTime = end - programTime ;
336
340
337
341
if ( compilerOptions . listFiles ) {
338
342
forEach ( program . getSourceFiles ( ) , file => {
@@ -353,10 +357,19 @@ module ts {
353
357
reportStatisticalValue ( "Memory used" , Math . round ( memoryUsed / 1000 ) + "K" ) ;
354
358
}
355
359
356
- reportTimeStatistic ( "Parse time" , ts . parseTime ) ;
360
+ // Individual component times.
361
+ // Note: we output 'programTime' as parseTime to match the tsc 1.3 behavior. tsc 1.3
362
+ // measured parse time along with read IO as a single counter. We preserve that
363
+ // behavior so we can accurately compare times. For actual parse times (in isolation)
364
+ // is reported below.
365
+ reportTimeStatistic ( "Parse time" , programTime ) ;
357
366
reportTimeStatistic ( "Bind time" , ts . bindTime ) ;
358
367
reportTimeStatistic ( "Check time" , ts . checkTime ) ;
359
368
reportTimeStatistic ( "Emit time" , ts . emitTime ) ;
369
+
370
+ reportTimeStatistic ( "Parse time w/o IO" , ts . parseTime ) ;
371
+ reportTimeStatistic ( "IO read" , ts . ioReadTime ) ;
372
+ reportTimeStatistic ( "Compile time" , compileTime ) ;
360
373
reportTimeStatistic ( "Total time" , end ) ;
361
374
}
362
375
0 commit comments