Skip to content

Commit 66fc899

Browse files
committed
fix(bench): add 2 warmup runs and raise INCREMENTAL_RUNS to 5 for incremental tiers
1 parent 909e1df commit 66fc899

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

scripts/benchmark.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ try {
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;
9495
const QUERY_RUNS = 5;
9596
const QUERY_WARMUP_RUNS = 3;
9697
const PROBE_FILE = path.join(root, 'src', 'domain', 'queries.ts');
@@ -154,6 +155,9 @@ const dbSizeBytes = fs.statSync(dbPath).size;
154155
console.error(` [${engine}] Benchmarking no-op rebuild...`);
155156
let noopRebuildMs = null;
156157
try {
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');
170174
let oneFileRebuildMs = null;
171175
let oneFilePhases = null;
172176
try {
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

Comments
 (0)