singularity-forge/native/crates/engine/src
Flux Labs c8b42ed2ae feat: native perf optimizations — deriveState, JSONL, paths, parsing (#576)
Four native Rust optimizations to eliminate hot-path bottlenecks:

1. deriveState raw content (gsd_parser.rs, state.ts):
   - Added rawContent field to ParsedGsdFile in batch parser
   - Eliminates 43-line frontmatter re-serialization loop in state.ts
   - Batch cache now stores original file content directly

2. JSONL streaming parser (gsd_parser.rs, session-forensics.ts):
   - Added parseJsonlTail() — reads from file tail with constant memory
   - Handles arbitrary file sizes (no more 10MB OOM risk)
   - synthesizeCrashRecovery and readLastActivityLog use native first

3. Native directory tree index (gsd_parser.rs, paths.ts):
   - Added scanGsdTree() — walks .gsd/ tree once, returns all entries
   - paths.ts builds lookup map from native scan
   - cachedReaddirWithTypes/cachedReaddir check native cache first
   - Eliminates 20-50 readdirSync calls per dispatch

4. Native plan/summary parsers (gsd_parser.rs, files.ts):
   - Added parsePlanFile() — parses tasks, must-haves, estimates
   - Added parseSummaryFile() — parses frontmatter, sections, files
   - files.ts calls native first, falls back to JS regex parsers
   - 3-5x faster per file, ~20 files per deriveState

All optimizations follow the established pattern: native-first with
JS fallback when native module unavailable.
2026-03-15 20:16:42 -06:00
..
ast.rs feat: add native ast module with ast-grep structural search and rewrite 2026-03-13 13:02:29 -06:00
clipboard.rs feat: add native clipboard module with arboard backend (#228) 2026-03-13 12:48:27 -06:00
diff.rs feat: add native Rust diff engine for edit tool 2026-03-13 14:11:40 -06:00
fd.rs perf: optimize discovery and interactive hot paths 2026-03-14 16:03:44 -05:00
fs_cache.rs perf: optimize discovery and interactive hot paths 2026-03-14 16:03:44 -05:00
git.rs feat: move git operations to Rust via git2 crate (#572) 2026-03-15 20:02:10 -06:00
glob.rs feat: add native glob and fs_cache modules with gitignore-aware discovery (#226) 2026-03-13 12:45:56 -06:00
glob_util.rs feat: add native glob and fs_cache modules with gitignore-aware discovery (#226) 2026-03-13 12:45:56 -06:00
grep.rs perf: optimize discovery and interactive hot paths 2026-03-14 16:03:44 -05:00
gsd_parser.rs feat: native perf optimizations — deriveState, JSONL, paths, parsing (#576) 2026-03-15 20:16:42 -06:00
highlight.rs feat: add syntect-based syntax highlighting module to native engine (#227) 2026-03-13 12:47:02 -06:00
html.rs feat: add html-to-markdown native module 2026-03-13 12:40:42 -06:00
image.rs feat: add native image module — decode, encode, and resize via Rust image crate 2026-03-13 12:51:49 -06:00
json_parse.rs feat: native Rust streaming JSON parser (#266) 2026-03-13 16:21:58 -06:00
lib.rs feat(native): add libgit2-backed git read operations for dispatch hotpath (#388) 2026-03-14 13:07:02 -06:00
ps.rs feat: add cross-platform process tree kill module (ps) (#225) 2026-03-13 12:43:50 -06:00
stream_process.rs feat: native Rust bash stream processor for single-pass chunk processing (#271) 2026-03-13 16:34:17 -06:00
task.rs feat: add native image module — decode, encode, and resize via Rust image crate 2026-03-13 12:51:49 -06:00
text.rs feat: add ANSI-aware text measurement and slicing native module 2026-03-13 12:42:42 -06:00
truncate.rs feat: native Rust output truncation module (#268) 2026-03-13 16:48:49 -06:00
ttsr.rs feat: add native Rust TTSR regex engine via RegexSet 2026-03-13 13:57:12 -06:00
xxhash.rs feat: native Rust xxHash32 for hashline (#272) 2026-03-13 16:46:08 -06:00