mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 22:36:08 +00:00
* perf(hopper): resolve string search records once per query search_strings called _string_inventory(document) once per match, and each call sorts every string address and rebuilds the record dict, so a query cost O(matches x strings log strings). Resolve the inventory once per search. Warm search, 50% matches, fake document, best of 7: 1000 strings 186 -> 0.5 ms, 4000 strings 3161 -> 2.1 ms, 8000 strings 13121 -> 4.9 ms; output byte-identical. * perf(hopper): skip record resolution for empty string searches Resolving the full string inventory for a query with no matches added a sort of every string address that the previous code never performed. Return early when nothing matches. Zero-match search on a warm document, best of 7: 64000 strings 35.9 ms before this change, 4.0 ms after (main: 3.9 ms).