Skip to content

fix(app): reduce session spinner CPU usage - #42952

Merged
Hona merged 5 commits into
anomalyco:v2from
Hona:session-spinner-bench
Aug 17, 2026
Merged

Hona merged 5 commits into
anomalyco:v2from
Hona:session-spinner-bench

Conversation

@Hona

@Hona Hona commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

Summary

  • replace 25 per-dot CSS opacity animations with one shared pre-rendered APNG timeline
  • preserve the eight source poses, smooth ease-out interpolation, currentColor, SVG props, and reduced-motion behavior
  • use a 1x animated alpha map plus one vector dot clip so every square keeps the old SVG edges at any display size
  • render the baked alpha mask directly and apply runtime color through an SVG alpha filter
  • add a deterministic generator for the 108-frame, 1.2-second alpha animation
  • add a Storybook stress story that fills the viewport with the shared component

Benchmark

Measured at the production 16 px size in headed Chromium with hardware acceleration enabled on an NVIDIA RTX 3080 Ti Laptop GPU and 20 logical processors. Each result is the median of three five-second samples.

20 indicators Legacy Baked Alpha Mask
Browser animation tracks 500 0
Task Manager-equivalent total CPU 5.85% 1.40%
Renderer main-thread use, one core 0.20% 0.07%

This reduces total CPU by about 76% for the original 20-indicator stress case.

Testing

  • bun typecheck in packages/app
  • bun run typecheck:e2e in packages/app
  • bun typecheck in packages/session-ui
  • bun test in packages/session-ui (87 passed)
  • deterministic APNG regeneration check
  • Chromium pixel check confirms the radar changes direction after 300 ms
  • Chromium edge check confirms the Baked Mask has the same hard square boundaries as the old SVG at 32 px
  • Chromium checks for reduced motion and currentColor

The full pre-push monorepo type check passed 32 of 33 packages. packages/www is blocked because its generated Blume Astro config imports @astrojs/mdx, which is not linked as a direct workspace dependency. No website files are changed by this PR.

@Hona
Hona requested a review from Brendonovich as a code owner August 17, 2026 00:12
Copilot AI lite review requested due to automatic review settings August 17, 2026 00:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Hona
Hona marked this pull request as draft August 17, 2026 00:18
@Hona
Hona marked this pull request as ready for review August 17, 2026 00:25
@Hona
Hona merged commit be8f975 into anomalyco:v2 Aug 17, 2026
7 of 9 checks passed
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 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