Skip to content

[codex] Improve runtime efficiency on mobile and desktop#1

Draft
Metadrew wants to merge 1 commit into
ybouane:mainfrom
Metadrew:codex/mobile-efficiency
Draft

[codex] Improve runtime efficiency on mobile and desktop#1
Metadrew wants to merge 1 commit into
ybouane:mainfrom
Metadrew:codex/mobile-efficiency

Conversation

@Metadrew
Copy link
Copy Markdown

What changed

This PR reduces runtime cost across both mobile and desktop without changing the public API.

  • parks the render loop completely when nothing is dirty instead of continuously scheduling frames
  • adds adaptive mobile quality scaling by capping effective DPR and downsampling blur passes on constrained / coarse-pointer devices
  • adds per-frame desktop caches for bounds, padded rects, dynamic/media descendant lookups, media fit styles, and canvas contexts to avoid repeated CPU work across overlapping glass panels
  • updates the demo page to use the local built bundle and refreshes the README / demo limitations text to reflect the new runtime behavior

Why

The original implementation looked great but could be CPU intensive on mobile and still repeated a lot of layout/query work on desktop when multiple glass panels overlapped. This pass keeps the visual result intact while reducing idle work and trimming the hottest repeated paths.

Impact

  • static scenes now go fully idle until something changes
  • mobile devices should run cooler and spend less time in blur / raster work
  • desktop keeps full quality while doing less repeated per-frame CPU bookkeeping
  • demo and documentation now describe the optimized behavior more accurately

Validation

  • npm ci
  • npm run build

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