mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-27 16:01:54 +00:00
- Implemented LexicalIndex class in src/services/memory/retriever.js. - Added WeakMap caching for indices based on memory array references. - Improved memory array stability in src/services/memory/index.js using a storeVersion counter. - Achieved ~2x speedup for 10k memories and ~9x speedup for 100k memories in benchmarks. - Maintains compatibility with existing textMatchSimilarity scoring. Co-authored-by: PR0M3TH3AN <[email protected]>
483 B
483 B
Lexical Search Optimized Performance
Date: Fri Feb 20 03:36:33 UTC 2026
Summary
Implemented an inverted index with a WeakMap cache. The performance boost is significant, especially as the number of memories grows.
Comparison (10,000 memories, 100 queries)
- Baseline: 15.80ms / query
- Optimized: 7.50ms / query
- Improvement: 2.1x speedup
Comparison (100,000 memories, 10 queries)
- Baseline: 118.91ms / query
- Optimized: 13.41ms / query
- Improvement: 8.8x speedup