ITADN

Search: debounce search-as-you-type to reduce per-keystroke work

#731Pull RequestRaulitoRS97 创建于 2026-06-27
R
RaulitoRS97commented
The library search bars (Songs, Artists, Albums list/grid and the add-to-playlist pickers) ran a Core Data fetch plus a table/collection reload on every keystroke, which stuttered on large libraries. The global search additionally fired a network request and a background fetch per keystroke. Add a small SearchDebouncer (200 ms, trailing edge) shared by all search-as-you-type screens. Clearing the field runs immediately so the full list / search history reappears without delay; a new keystroke cancels the pending work item. Measured on a ~50k-song library, typing a 6-character query: local Core Data searches 6 -> 1, API search calls 6 -> 1.
合并状态:未合并 1 条评论