Skip to content

perf(gjs): bake map previews off-frame through a queue#215

Merged
JumpLink merged 2 commits into
mainfrom
perf/map-preview-bake-queue
Jun 12, 2026
Merged

perf(gjs): bake map previews off-frame through a queue#215
JumpLink merged 2 commits into
mainfrom
perf/map-preview-bake-queue

Conversation

@JumpLink

Copy link
Copy Markdown
Contributor

The ported worlds have 100k+ tiles; the old path painted every tile
as a clipped GSK node in the widget snapshot AND rebuilt the same
node tree for the bake — millions of GI calls on the main thread,
twice, for thumbnails whose tiles end up ~1.4px.

  • never paint tiles in vfunc_snapshot: accent + room colour until
    the bake lands, then the texture (O(1))
  • module-wide bake queue, one bake per idle at idle priority, so
    19 atlas cards become short steps between frames
  • LRU cache (48 textures) keyed by a map-content fingerprint —
    atlas re-entry reuses textures, edits re-bake exactly the maps
    that changed; welcome thumbnails serve the cached texture
    instantly and refresh in the background
  • reuse the Graphene temps in the per-tile loop and drop the op
    list once baked (six-figure object arrays per big map)

JumpLink added 2 commits June 12, 2026 16:05
The ported worlds have 100k+ tiles; the old path painted every tile
as a clipped GSK node in the widget snapshot AND rebuilt the same
node tree for the bake — millions of GI calls on the main thread,
twice, for thumbnails whose tiles end up ~1.4px.

- never paint tiles in vfunc_snapshot: accent + room colour until
  the bake lands, then the texture (O(1))
- module-wide bake queue, one bake per idle at idle priority, so
  19 atlas cards become short steps between frames
- LRU cache (48 textures) keyed by a map-content fingerprint —
  atlas re-entry reuses textures, edits re-bake exactly the maps
  that changed; welcome thumbnails serve the cached texture
  instantly and refresh in the background
- reuse the Graphene temps in the per-tile loop and drop the op
  list once baked (six-figure object arrays per big map)
@JumpLink JumpLink merged commit 6b2234c into main Jun 12, 2026
1 check 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.

1 participant