9090 if ( typeof parser . disposeParsers === 'function' ) disposeParsers = parser . disposeParsers ;
9191} catch { /* older release — no worker pool to dispose */ }
9292
93- const INCREMENTAL_RUNS = 3 ;
93+ const WARMUP_RUNS = 2 ;
94+ const INCREMENTAL_RUNS = 5 ;
9495const QUERY_RUNS = 5 ;
9596const QUERY_WARMUP_RUNS = 3 ;
9697const PROBE_FILE = path . join ( root , 'src' , 'domain' , 'queries.ts' ) ;
@@ -154,6 +155,9 @@ const dbSizeBytes = fs.statSync(dbPath).size;
154155console . error ( ` [${ engine } ] Benchmarking no-op rebuild...` ) ;
155156let noopRebuildMs = null ;
156157try {
158+ for ( let i = 0 ; i < WARMUP_RUNS ; i ++ ) {
159+ await buildGraph ( root , { engine, incremental : true , exclude : BENCH_EXCLUDE } ) ;
160+ }
157161 const noopTimings = [ ] ;
158162 for ( let i = 0 ; i < INCREMENTAL_RUNS ; i ++ ) {
159163 const start = performance . now ( ) ;
@@ -170,6 +174,10 @@ const original = fs.readFileSync(PROBE_FILE, 'utf8');
170174let oneFileRebuildMs = null ;
171175let oneFilePhases = null ;
172176try {
177+ for ( let i = 0 ; i < WARMUP_RUNS ; i ++ ) {
178+ fs . writeFileSync ( PROBE_FILE , original + `\n// warmup-${ i } \n` ) ;
179+ await buildGraph ( root , { engine, incremental : true , exclude : BENCH_EXCLUDE } ) ;
180+ }
173181 const oneFileRuns = [ ] ;
174182 for ( let i = 0 ; i < INCREMENTAL_RUNS ; i ++ ) {
175183 fs . writeFileSync ( PROBE_FILE , original + `\n// probe-${ i } \n` ) ;
0 commit comments