Commit 5d93d25
authored
fix(bench): discard warmup runs in query benchmark median (#1077)
* fix(bench): discard warmup runs in query benchmark median (#1076)
The native fn_deps NAPI path pays a cold-start cost on the first 2-3
calls per worker process — rusqlite statement-cache warmup, OS page
cache fill for the DB file, and NAPI-side static init from
tree-sitter 0.25's transitive crates (indexmap, hashbrown, equivalent)
linked into the .node binary at #1054.
The benchmark's median(5) sample then lands inside cold-start
territory rather than warm steady-state, which is what the regression
gate is supposed to track. On Linux x86_64 CI that surfaced as
fnDeps depth 1 native: 28.7 → 48.6 (+69%) once #1054 enlarged the
binary's init footprint, even though warm per-call latency is
unchanged from v3.9.6.
Run two warmup iterations per (depth, fn) before timing so all 5
sampled timings are warm. Verified on Linux x86_64 (Docker, qemu):
native d1 178.2ms → 119.6ms, now matching the warm d3/d5 plateau
(122/113ms). Wasm path is unaffected by the change since wasm only
ever paid cold-start on its first iteration.
Closes #1076
* fix(bench): bump WARMUP_RUNS from 2 to 3 to match documented worst-case cold-start (#1077)1 parent 4d26f08 commit 5d93d25
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
111 | 120 | | |
112 | 121 | | |
113 | 122 | | |
| |||
172 | 181 | | |
173 | 182 | | |
174 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
175 | 187 | | |
176 | 188 | | |
177 | 189 | | |
| |||
0 commit comments