Commit b8ee323
perf(native): skip backfill on clean incrementals + bench guard tuning (#1085)
* perf(native): skip backfill on incrementals when orchestrator preserved files
#1069 made `backfillNativeDroppedFiles` run on every successful orchestrator
pass — including incrementals — to repair `nodes`/`file_hashes` rows the
orchestrator deleted for files outside its narrower file_collector (Clojure,
Julia, R, Erlang, F#, Gleam, etc.).
#1070 then taught the orchestrator's `detect_removed_files` to skip those
extensions, so a current-binary 1-file rebuild reports `removedCount=0` and
the orchestrator never deletes the dropped-language rows in the first place.
But the JS side kept calling backfill unconditionally — wasting ~45ms per
incremental on this repo (fs walk + 2 DB queries + WASM re-parse of all 48
unsupported-extension fixture files) repairing a gap that no longer exists.
Gate the backfill call on `result.isFullBuild || result.removedCount > 0`:
- Full builds: backfill runs (orchestrator never inserted dropped-language
files, gap-fill is the whole point).
- Incrementals on a current binary with #1070: `removedCount=0`, backfill
skipped, no work needed.
- Incrementals on a legacy binary (≤3.9.6) without #1070: `removedCount>0`,
backfill runs, gap-repair behavior preserved.
Local measurement on this repo (incremental-benchmark.ts, native engine):
before: 1-file rebuild ~108ms (post-revert main, no fix)
after: 1-file rebuild ~60ms
Closes #1075.
* test(bench): bump regression threshold to 50% and prune stale exemptions
Sub-30ms metrics (no-op rebuild, 1-file rebuild) routinely jitter ±10ms
on CI runners from runner load, GC pauses, and OS scheduling, which
translates to ±50%+ on small absolute numbers. The 25% threshold was
flagging these as regressions even when the underlying work hadn't
changed.
Empirically verified the v3.10.0 No-op rebuild slowdown is real but
small: ~3-7ms / ~25-35% locally (v3.9.6 source+binary measured at
14-19ms steady-state vs HEAD at 18-22ms). CI's +120% reflects metric
noise floor on a sub-30ms baseline, not a 2x slowdown. Confirmed by
toggling the JS-side fast-skip pre-flight (#1064) off — the
orchestrator-only path is the same speed, ruling out #1064 as cause.
Add 3.10.0:No-op rebuild to KNOWN_REGRESSIONS with the empirical
breakdown. Likely contributors are the is_supported_extension filter
in detect_removed_files (#1070), the larger file_hashes row set after
#1069, and tree-sitter 0.24→0.25 — each costs a few hundred μs and
together explain the local delta.
Prune 6 dead entries (3.9.0/3.9.1/3.9.2 across 1-file rebuild, fnDeps
depths, Full build) — these only fire when their version is `latest`,
which never happens with current committed history (latest is 3.9.6
across all three benchmark files). Document the convention so future
pruning is mechanical.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
* fix: backfill on incrementals when changedCount > 0 (#1085)
Broaden the backfill guard to also fire when result.changedCount > 0,
not just on full builds or removals. This narrows the gap where new
unsupported-extension files could be silently dropped on incrementals
that had any orchestrator-detected file activity.
The residual gap (new unsupported file added on a fully quiet
incremental) is tracked in #1091.
* fix: keep 25% regression threshold; widen only for noisy sub-30ms metrics (#1085)
Restore REGRESSION_THRESHOLD to 0.25 so the 30-100ms range is still
guarded against silent regressions. Add a NOISY_METRICS set with a
separate 0.50 tolerance for the genuinely high-variance sub-30ms
timing metrics (No-op rebuild, 1-file rebuild). The previous blanket
50% would have let a 50ms->74ms (+48%) real regression pass silently.
---------
Co-authored-by: Claude Opus 4.7 <[email protected]>1 parent 569faf7 commit b8ee323
2 files changed
Lines changed: 63 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
763 | 767 | | |
764 | | - | |
| 768 | + | |
| 769 | + | |
765 | 770 | | |
766 | 771 | | |
767 | 772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
29 | 55 | | |
30 | 56 | | |
31 | 57 | | |
| |||
63 | 89 | | |
64 | 90 | | |
65 | 91 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
82 | 95 | | |
83 | 96 | | |
84 | 97 | | |
| |||
98 | 111 | | |
99 | 112 | | |
100 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
101 | 126 | | |
102 | 127 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 128 | | |
110 | 129 | | |
111 | 130 | | |
112 | 131 | | |
113 | 132 | | |
| 133 | + | |
114 | 134 | | |
115 | 135 | | |
116 | 136 | | |
| |||
281 | 301 | | |
282 | 302 | | |
283 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
284 | 308 | | |
285 | 309 | | |
286 | 310 | | |
287 | | - | |
| 311 | + | |
288 | 312 | | |
289 | 313 | | |
290 | 314 | | |
| |||
293 | 317 | | |
294 | 318 | | |
295 | 319 | | |
296 | | - | |
| 320 | + | |
297 | 321 | | |
298 | 322 | | |
299 | | - | |
300 | | - | |
301 | | - | |
| 323 | + | |
302 | 324 | | |
303 | 325 | | |
304 | 326 | | |
| |||
0 commit comments