Skip to content

Hear marker writes through onChange, not a Combine subscription each - #24

Merged
wf9a5m75 merged 1 commit into
developfrom
perf/marker-change-listener
Nov 21, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
perf/marker-change-listener

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

Switching the provider on the street trees page (144,183 markers) froze the screen for 6.4–6.5 s on an iPad Pro. 3.5 s of that was the new map's marker controller subscribing to every marker's asFlow(), and 1.8–2.0 s was the old map's controller cancelling those subscriptions.

The controller now hears marker writes through MarkerState.onChange (MapConductor/ios-sdk-core#51), which costs one allocation per marker. As before, nothing is called on subscribe, and the closure runs on the main queue after each write.

Measured with the Google Maps and MapLibre controllers: the freeze is now 1.19–1.27 s. After each switch, marker icon writes still reach the new map; this was checked with screenshots of the street-tree labels. The same change is applied to all 10 providers.

Switching the provider on the street trees page (144,183 markers) held
the main thread for 6.5 s on an iPad Pro. 3.5 s was this controller
subscribing to every marker's asFlow(), and 2 s the old map's controller
cancelling them. MarkerState.onChange (ios-sdk-core) costs an allocation
per marker.
@wf9a5m75
wf9a5m75 merged commit 1b70e54 into develop Nov 21, 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