@@ -253,7 +253,16 @@ async function main() {
253253 const browser = await chromium . launch ( { headless : true } ) ;
254254 const libraries = process . env . CI ? [ 'data-client' ] : [ ...LIBRARIES ] ;
255255
256+ const scenarioCount = SCENARIOS_TO_RUN . length ;
256257 for ( let round = 0 ; round < TOTAL_RUNS ; round ++ ) {
258+ const phase = round < WARMUP_RUNS ? 'warmup' : 'measure' ;
259+ const phaseRound =
260+ round < WARMUP_RUNS ? round + 1 : round - WARMUP_RUNS + 1 ;
261+ const phaseTotal = round < WARMUP_RUNS ? WARMUP_RUNS : MEASUREMENT_RUNS ;
262+ process . stderr . write (
263+ `\n── Round ${ round + 1 } /${ TOTAL_RUNS } (${ phase } ${ phaseRound } /${ phaseTotal } ) ──\n` ,
264+ ) ;
265+ let scenarioDone = 0 ;
257266 for ( const lib of shuffle ( libraries ) ) {
258267 const context = await browser . newContext ( ) ;
259268 const page = await context . newPage ( ) ;
@@ -265,9 +274,22 @@ async function main() {
265274 results [ scenario . name ] . push ( result . value ) ;
266275 reactCommitResults [ scenario . name ] . push ( result . reactCommit ?? NaN ) ;
267276 traceResults [ scenario . name ] . push ( result . traceDuration ?? NaN ) ;
277+ scenarioDone ++ ;
278+ const unit =
279+ scenario . resultMetric === 'heapDelta' ? 'bytes'
280+ : (
281+ scenario . resultMetric === 'itemRefChanged' ||
282+ scenario . resultMetric === 'authorRefChanged'
283+ ) ?
284+ 'count'
285+ : 'ms' ;
286+ process . stderr . write (
287+ ` [${ scenarioDone } /${ scenarioCount } ] ${ scenario . name } : ${ result . value . toFixed ( 2 ) } ${ unit } ${ result . reactCommit != null ? ` (commit ${ result . reactCommit . toFixed ( 2 ) } ms)` : '' } \n` ,
288+ ) ;
268289 } catch ( err ) {
290+ scenarioDone ++ ;
269291 console . error (
270- `Scenario ${ scenario . name } failed :` ,
292+ ` [ ${ scenarioDone } / ${ scenarioCount } ] ${ scenario . name } FAILED :` ,
271293 err instanceof Error ? err . message : err ,
272294 ) ;
273295 }
@@ -285,16 +307,22 @@ async function main() {
285307 }
286308 const STARTUP_RUNS = 5 ;
287309 for ( let round = 0 ; round < STARTUP_RUNS ; round ++ ) {
310+ process . stderr . write (
311+ `\n── Startup round ${ round + 1 } /${ STARTUP_RUNS } ──\n` ,
312+ ) ;
288313 for ( const lib of shuffle ( [ ...LIBRARIES ] ) ) {
289314 const context = await browser . newContext ( ) ;
290315 const page = await context . newPage ( ) ;
291316 try {
292317 const m = await runStartupScenario ( page , lib ) ;
293318 startupResults [ lib ] . fcp . push ( m . fcp * 1000 ) ;
294319 startupResults [ lib ] . tbt . push ( m . taskDuration * 1000 ) ;
320+ process . stderr . write (
321+ ` ${ lib } : fcp ${ ( m . fcp * 1000 ) . toFixed ( 2 ) } ms, task ${ ( m . taskDuration * 1000 ) . toFixed ( 2 ) } ms\n` ,
322+ ) ;
295323 } catch ( err ) {
296324 console . error (
297- `Startup ${ lib } failed :` ,
325+ ` ${ lib } startup FAILED :` ,
298326 err instanceof Error ? err . message : err ,
299327 ) ;
300328 }
@@ -397,6 +425,13 @@ async function main() {
397425 entry . name += BENCH_LABEL ;
398426 }
399427 }
428+ process . stderr . write ( `\n── Results (${ report . length } metrics) ──\n` ) ;
429+ for ( const entry of report ) {
430+ process . stderr . write (
431+ ` ${ entry . name } : ${ entry . value } ${ entry . unit } ${ entry . range } \n` ,
432+ ) ;
433+ }
434+ process . stderr . write ( '\n' ) ;
400435 process . stdout . write ( formatReport ( report ) ) ;
401436}
402437
0 commit comments