From dde0465e303f259999d3820a0c26e4a237fa89ee Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 23 Sep 2026 20:27:34 +0800 Subject: [PATCH] perf: skip restoration rebuilds after warm sessions --- scripts/benchmark.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/benchmark.ts b/scripts/benchmark.ts index 599e1493d..ae60166ec 100644 --- a/scripts/benchmark.ts +++ b/scripts/benchmark.ts @@ -833,9 +833,9 @@ async function runDevSession( `${buildTool.name} dev (${cache}, timing): ${startupTime}ms`, ); } - // Measurement is over. Restore the exact baseline while the server is - // alive, await each rebuild, then let graceful shutdown flush the cache. - if (runHmr) { + // Restore the baseline for the following warm startup, awaiting each + // rebuild before graceful shutdown flushes the cache. + if (cache === 'cold') { for (const file of files) await updateModule(file.path, file.baseline, file.marker); }