Skip to content

perf(ui): defer results fetch to render-eligible ticks#1074

Draft
alexpasmantier wants to merge 3 commits into
mainfrom
perf/defer-results-fetch-to-render
Draft

perf(ui): defer results fetch to render-eligible ticks#1074
alexpasmantier wants to merge 3 commits into
mainfrom
perf/defer-results-fetch-to-render

Conversation

@alexpasmantier

Copy link
Copy Markdown
Owner

Summary

  • Television::update() was running the full results pipeline (matcher lock, index computation, per-item to_string + clone) on every tick (~50 Hz), while the renderer only consumes new state at ~17 Hz under load and ~2 Hz idle. Under heavy load (large source streams, big corpora) the redundant work starves keystrokes and renders.
  • Now the results pipeline only runs on render-eligible ticks. Counts are refreshed every tick via a new cheap Matcher::update_counts() so select_1 / take_1 / status bar stay accurate.

Test plan

  • tv files or find ~ -type f | tv on a large tree — UI stays responsive while loading; typing feels snappier
  • select_1 / take_1 / take_1_fast flows still trigger correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant