Skip to content

Redraw tiles once per burst of tiled-marker changes - #18

Merged
wf9a5m75 merged 1 commit into
developfrom
perf/tiled-marker-update
Nov 5, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
perf/tiled-marker-update

Conversation

@wf9a5m75

@wf9a5m75 wf9a5m75 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Per-marker updates on tiled markers swapped the raster layer and ran onPostProcess (copying ~144k entries) once per marker. Relabelling the street-tree sample took ~6.1 s.

  • Tiled-marker updates schedule a single coalesced refresh (16 ms, under the controller semaphore).
  • Skip onPostProcess unless the marker was native before.
  • Only build the bitmap icon on the native path.

Street-tree relabel: 6.1 s → 0.25 s on Pixel 5a.

Relabelling street trees changes a few dozen tiled markers at once, and each
change went through update() separately:
- the raster source was replaced per marker, and the map fetched every
  visible tile again each time (45 replacements, 494 tile renders, the last
  tile 6.1 s after the change, on a Pixel 5a);
- renderer.onPostProcess() copied all 144k entities to redraw the native
  ones, although nothing native had changed (50 ms each, 2.3 s in total);
- the icon was baked and all entities copied just to count them.

Now changes arriving within a frame share one source replacement,
onPostProcess runs only when a native marker became tiled, the icon is baked
only for a native marker, and the count is read without copying. Same burst:
one replacement, 19 tile renders, the last tile 0.25 s after the change.
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