perf(backgrounds): animated chat backgrounds cost ~5% CPU instead of 50 to 70% (#337) #361
Merged
jared
merged 2 commits from 2026-10-16 20:52:35 -04:00
fix/animated-bg-compositor into lotus
No Reviewers
Labels
Clear labels
a11y
area: appearance
area: auth-session
area: build-ci
area: calls
area: desktop
area: media
area: messaging
area: mobile
area: moderation
area: navigation
area: notifications
area: settings
area: threads
bug
dependencies
docs
duplicate
enhancement
help wanted
invalid
needs-human-review
performance
planning
priority: critical
priority: high
priority: low
priority: medium
qa
question
research
security
tech-debt
ux
wontfix
Accessibility: keyboard, screen reader, contrast, motion
Client area: appearance
Client area: auth-session
Client area: build-ci
Client area: calls
Client area: desktop
Client area: media
Client area: messaging
Client area: mobile
Client area: moderation
Client area: navigation
Client area: notifications
Client area: settings
Client area: threads
Something is not working
Third-party package versions and advisories
README / LOTUS_* docs wrong or missing
This issue or pull request already exists
New feature
Need some help
Something is wrong
Re-render storms, leaks, heavy work on hot paths
Data loss, security hole, or crash on a main path
Broken feature or serious usability problem
Minor issue or polish
Wrong behaviour in an edge case or notable degradation
Manual QA: shipped, needs a human in a real environment
More information is needed
XSS, unsafe URLs, data leaks, auth/session
Code health, dead code, fragile patterns
Usability or visual inconsistency
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: LotusGuild/cinny#361
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #337.
background-positioncan't run on the compositor, so every frame of the animated chat backgrounds repainted the whole chat area. That cost 51 to 72% main-thread busy while sitting idle in a room at 60 fps.The drifts are slow: 3 to 22 px/s, under a pixel per frame. So each animation now uses
steps(): about 12 updates/s for fireflies, stars and aurora, and about 24/s for the faster rain and pulse.Measured headless (20 s idle in a room, CDP
TaskDuration):Visual note: aurora and pulse used
ease-in-out. Withsteps(), their motion is now even-paced. The layers and colours are unchanged, and Pause animations / reduced motion still remove the animation entirely.tscclean · unit tests pass · ESLint/Prettier clean.🤖 Generated with Claude Code
https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5