Skip to content

perf(agent-control): reduce proposal countdown churn - #528

Merged
Harry19081 merged 3 commits into
junyu/rpc-performance-closurefrom
perf/agent-control-countdown
Jul 28, 2026
Merged

perf(agent-control): reduce proposal countdown churn#528
Harry19081 merged 3 commits into
junyu/rpc-performance-closurefrom
perf/agent-control-countdown

Conversation

@beruro

@beruro beruro commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace frame-rate countdown updates with a single one-second timer
  • pause countdown work while the window is hidden and recalculate from the absolute expiry time on foreground
  • own timer/listener teardown in a small scheduler with lifecycle regression tests

Performance guard

  • active/visible: at most one timer and one update per second
  • hidden: no timer remains armed
  • visible again: one immediate recalculation, then one timer
  • unmount/reopen: timer and listener are removed; every scheduler instance owns isolated state
  • failure/retry: not applicable; this path performs no I/O

Verdict: PASS. The change removes approximately 60 React updates per second from the five-minute proposal window and retains bounded O(1) state.

Verification

  • vitest run src/scaffold/GlobalSpotlight/palettes/AgentControlPalette/countdownScheduler.test.ts (3 tests)
  • tsc --noEmit
  • focused ESLint
  • Prettier check
  • git diff --check

@beruro
beruro changed the base branch from develop to junyu/rpc-performance-closure July 27, 2026 05:10
@beruro

beruro commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

Restacked onto #512. This PR now contains only the extracted countdown scheduler and its regression coverage (3 files). Merge #512 first, then retarget to develop for CI.

@Harry19081
Harry19081 merged commit ba66dbf into junyu/rpc-performance-closure Jul 28, 2026
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.

2 participants