GitNexus/gitnexus/src
Gergő Magyar 0d1aed942f
docs(bench): close FTS as an optimization target with measured evidence (#3209)
PR #3208 landed two claims that further measurement disproved.

The narrowing is not inconsistent. A true incremental leaf edit rebuilds
exactly 8 of the 20 configured indexes -- the tables the writeback DMLs --
and the 20-index run I compared it against was a forced full rebuild
(runner-identity trap). Per-index costs for those 8 sum to 7769ms against
the 7525ms measured in-analyze. There is nothing to fix in `touchedFts`.

The 845ms was not `import('./platform/capabilities.js')`. The CLI already
imports that module statically; a cached dynamic import measures 0.035ms.
The `await` is the first yield after the native FTS build and absorbs the
libuv work still queued behind it. Recorded as a fourth measurement trap,
since it invalidates any mark placed on an await that follows native work.

What replaces them is a floor, established by probing a copy of the corpus
index directly:

  - narrowing further: nothing left, the 8 tables are exactly the DML'd set
  - concurrent builds: hard error, one write transaction at a time
  - connection thread count: flat at 4/8/16/24 (7298/7133/7109/7345ms
    min-of-3), though the default burns ~60% more CPU for it
  - dropping `content` from File: 3541ms -> 241ms, but that deletes
    full-file keyword search (#2317/#2323); capping is a bad trade because
    the size distribution is flat

The one lever left is overlap: the build runs on a libuv thread and hides
behind main-thread JS (3337ms for the index plus a 3000ms JS burn, against
~6859ms serial). File rows are `{ name, filePath }` from `processStructure`
with content lazy-read at CSV time, so they are known before parsing. What
blocks it is that the DB is closed for the whole pipeline and that an early
write moves `liveIndexMutationStarted` ahead of it.

The `ponytail:` comment in `createSearchFTSIndexes` invited exactly the fix
that cannot work -- every caller has already dropped the indexes it passes,
so a presence gate would never fire. Replaced with the measured reason.

Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 19:22:24 +01:00
..
cli fix(zig): vendor tree-sitter-zig so npm i -g no longer warns on peers (#3180) 2026-09-05 10:35:33 +01:00
config feat(analyze): add incremental watch mode (#3072) 2026-08-29 10:40:56 +00:00
core docs(bench): close FTS as an optimization target with measured evidence (#3209) 2026-09-07 19:22:24 +01:00
lib fix(mcp): stop scaling the detect_changes query with the diff's hunk count (#2915) (#2930) 2026-08-12 14:51:17 +01:00
mcp Merge branch 'main' into fix/skill-evolution-gate 2026-09-04 20:02:51 +01:00
server chore: release v1.6.11 (#3177) 2026-09-04 20:02:37 +01:00
storage feat: notify users when a newer gitnexus version is available (#3175) 2026-09-04 18:50:03 +01:00
types fix(analyze): add cold parser rebuild option (#3153) 2026-09-04 05:14:00 +01:00
utils feat: add gitnexus auto-sync for scheduled remote clone and analyze (#2493) 2026-09-02 19:40:18 +01:00