Skip to content

Hand Circles' list over as it is while it is the only writer - #20

Merged
wf9a5m75 merged 1 commit into
developfrom
perf/circles-list-handoff
Nov 21, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
perf/circles-list-handoff

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

Needs MapConductor/android-sdk-core#57 (stacked on #56 and #54), which adds OverlayStateList. Merge after that.

Why

Circles merged its list into a copy of the collector's persistent map at every change. In the antenna sample on a Pixel 5a, removing one carrier's 147k circles and putting back 576k took about 1.8 s, before the collector and overlay walked that map again.

What

While the published membership is still the list this Circles() published last (or there is nothing yet), and the ids of the new list are distinct, it publishes an OverlayStateList of its list. The list is copied once with toList(). Otherwise it merges into a copy of the map as before, so several Circles()/Circle() still share one collector. On dispose, if its list is still the published one, the membership becomes empty without building a map.

Measured (with android-sdk-core#57, carrier toggle, Pixel 5a, 3 runs)

  • Circles effect to published: 3.6–6.0 s → 0.74–0.80 s
  • tap to last tile drawn: 9.9–14.0 s → 6.6–7.2 s

Checked

  • :android-sdk-compose:testDebugUnitTest: 19 pass. apiCheck passes.
  • On the device:
    • toggles give the right counts;
    • the Alaska remount (dispose path) draws again with the selection kept.

Circles merged its list into a copy of the collector's persistent map at
every change: removing the 147k circles of one carrier and putting back
576k took about 1.8 s in the antenna sample on a Pixel 5a.

While the published membership is still the list this Circles()
published last (or there is nothing yet), and the ids are distinct, it
now publishes an OverlayStateList of its list instead. Otherwise it
merges as before, so several Circles()/Circle() still share a collector.
Needs android-sdk-core's OverlayStateList.
@wf9a5m75
wf9a5m75 merged commit 43eac2c into develop Nov 21, 2026
2 of 3 checks 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