Problem
For each query term, the search iterates ALL entries in the inverted index to find prefix matches. With thousands of unique terms, this is O(queryTerms * vocabularySize).
Location
src/state/search-index.ts:78-97
Suggested Fix
Use a trie or sorted array for prefix lookups instead of linear scan.
Problem
For each query term, the search iterates ALL entries in the inverted index to find prefix matches. With thousands of unique terms, this is O(queryTerms * vocabularySize).
Location
src/state/search-index.ts:78-97Suggested Fix
Use a trie or sorted array for prefix lookups instead of linear scan.