Commit eb5cd2a
committed
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.1 parent 21b0b6f commit eb5cd2a
1 file changed
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
765 | 767 | | |
766 | 768 | | |
767 | 769 | | |
| |||
0 commit comments