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
Perf: sidebar search lowercases every message of every thread per keystroke #144
electron/store.js:1021-1057 (searchThreads) does String(m.text).toLowerCase().includes(needle) across all threads' full message lists, with no index and no early cap on scan cost. The renderer fires it after a 250ms debounce (src/components/Sidebar.tsx:52,1203-1205).
Impact
Each keystroke burst allocates a lowercased copy of the entire store's message text on the main thread. With capped-but-large transcripts (1,000 messages x N threads) that is MBs of allocation and a full scan per query: a GC and latency spike while the user is typing.
Fix direction
Cache lowercased text per message (invalidate on append), or build a lightweight inverted index; also consider a max-results early exit.
Stale as of the sidebar redesign: search now matches only thread.title (src/components/Sidebar.tsx:1758, thread.title.toLowerCase().includes(queryLower)) — the per-keystroke scan over every message of every thread no longer exists. Verified by grep in perf research round 31b (2026-08-21): no message-body search remains in the renderer. Transcript search is now the separate feature request #486.
Activity
currentbits commentedon Aug 21, 2026
Stale as of the sidebar redesign: search now matches only thread.title (src/components/Sidebar.tsx:1758,
thread.title.toLowerCase().includes(queryLower)) — the per-keystroke scan over every message of every thread no longer exists. Verified by grep in perf research round 31b (2026-08-21): no message-body search remains in the renderer. Transcript search is now the separate feature request #486.