You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
search_recording redoes whole-index work on every query, and the per-segment grouping is quadratic #346
Every searchIndex call flattens every item in the index (OCR lines, events, transcript, and up to 50,000 log lines), re-masks all of them through the vm regex scan, and re-normalizes them. For a multi-word query, it then builds per-segment lists with bySeg.set(item.seg, [...(bySeg.get(item.seg) ?? []), i]), which copies the list on every item (O(k^2) per segment). With no input, library search reads and parses every *.index.json under SCREENCAST_HOME on each call. Nothing is cached, and all of it runs synchronously in the stdio server.
A segment with 20k items (a burst of log lines) costs about 2e8 element copies (roughly 1 s) per multi-word query. A library of about 100 indexed recordings is re-read, re-parsed and re-masked in full on every library query. While this runs, the server answers no other request.
Suggested fix
Build bySeg with push, or group items by segment once.
Activity