@@ -48,8 +48,8 @@ module.exports = ({ tmpdir } = {}) => {
4848 try {
4949 total = timeSpan ( )
5050 const compiled = await compilePromise
51- const installAndBuildMs = total ( )
5251
52+ const spawnElapsed = timeSpan ( )
5353 const subprocess = spawn ( {
5454 args : JSON . stringify ( args ) ,
5555 env : {
@@ -61,28 +61,20 @@ module.exports = ({ tmpdir } = {}) => {
6161 subprocess . stdin . on ( 'error' , ( ) => { } )
6262 Readable . from ( compiled . content ) . pipe ( subprocess . stdin )
6363 const { stdout } = await subprocess
64+ const spawnMs = spawnElapsed ( )
6465 const { isFulfilled, value, profiling, logging } = JSON . parse ( stdout )
65- const totalMs = total ( )
6666 const { run, ...rest } = profiling
6767 const result = {
6868 ...rest ,
6969 phases : {
7070 install : compiled . install ,
7171 build : compiled . build ,
72- spawn : totalMs - installAndBuildMs - run ,
72+ spawn : spawnMs - run ,
7373 run,
74- total : totalMs
74+ total : total ( )
7575 }
7676 }
77- debug ( 'node' , {
78- cpu : `${ Math . round ( result . cpu ) } ms` ,
79- memory : `${ Math . round ( result . memory / ( 1024 * 1024 ) ) } MiB` ,
80- phases : `install=${ Math . round ( result . phases . install ) } ms build=${ Math . round (
81- result . phases . build
82- ) } ms spawn=${ Math . round ( result . phases . spawn ) } ms run=${ Math . round (
83- result . phases . run
84- ) } ms total=${ Math . round ( result . phases . total ) } ms`
85- } )
77+ debug ( 'node' , { cpu : result . cpu , memory : result . memory , ...result . phases } )
8678
8779 return isFulfilled
8880 ? { isFulfilled, value, profiling : result , logging }
0 commit comments