Skip to content

Throttle range strip paint to rAF and debounce favicon update#214

Merged
ai merged 1 commit intoevilmartians:mainfrom
dkryaklin:optimize-main-thread-paint
Apr 20, 2026
Merged

Throttle range strip paint to rAF and debounce favicon update#214
ai merged 1 commit intoevilmartians:mainfrom
dkryaklin:optimize-main-thread-paint

Conversation

@dkryaklin
Copy link
Copy Markdown
Contributor

@dkryaklin dkryaklin commented Apr 20, 2026

Range strip gradients were painting synchronously inside runListeners on every color change, doing per-pixel color math on the main thread (~4 ms). During a rapid drag this blocks input events.

  • Coalesce the three ch / lc / lh strip paints into a single rAF-scheduled batch — a burst of input events paints at most once per frame with the latest value.
  • Debounce the favicon update to 300 ms.

@dkryaklin
Copy link
Copy Markdown
Contributor Author

Freeze sum dropped from 6 to 2

@ai ai merged commit c1b99c7 into evilmartians:main Apr 20, 2026
2 checks passed
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