- Switch from bun:sqlite back to better-sqlite3 (FTS5 5x faster)
- Streaming prepared statements instead of dynamic bulk SQL
- Merge small chunks (<30% of target) to reduce chunk count 4x
- Adaptive worker count based on file count (min of cores, files/50)
- Skip graph building on cold index (built lazily on first query)
- Skip SHA256 on cold index (use mtime:size as fingerprint)
- FTS backfill via single INSERT...SELECT instead of per-row inserts
- Buffer-based stripNonCode state machine (35% faster than regex)
- Fast tokenization approximation (chars/4) replacing gpt-tokenizer
- Cached batch timestamp for streaming inserts
Zed (2903 files): 33.6s -> 8.5s cold, 2.8s -> 1.0s warm