Repository navigation
Report when a tiler takes a list or draws tiles - #58
Merged
Merged
Conversation
listenToWrittenStates looked every id of the new map up in the old one and every id of the old map up in the new one: about 1.7 s on the main thread for the 576k/724k circles of the antenna sample on a Pixel 5a. The collector now listens through a PassToken replaced at every pass. A state in the new map is moved to the current token; a state of the old map still on an older token of this collector was not in the new one, and stops. One read per state, no lookups; an id is still looked up for a state not yet listening here, to stop what held that id before. The pass is now 1.2-1.3 s. Of that, merely iterating the PersistentOrderedMapBuilder is about 0.44 s per 576k entries (it looks the next key up at each step), which only a different hand-over can avoid.
A collector's membership is a MutableMap, and for a bulk collection that map was a PersistentOrderedMap of every state: building it took about 1.8 s per hand-over for the antenna sample's 576k circles on a Pixel 5a, and merely iterating it about 0.44 s per pass (it looks the next key up at each step), on the collector's pass and the overlay's toList. OverlayStateList is a MutableMap over the list a collection was given: iterating it walks the list, and only a key lookup builds an index. The collector's listener pass and CircleOverlay walk the list; the overlay hands the list itself to the controller, and the added-tracker gets the ids lazily. A write from the latest pass's token is known to be from a member without a lookup. A published map is still not to be written to; one that is follows its index. The ids must be distinct (the compose Circles hands a list over only when they are).
Adds TileActivity, counted across the tile threads: ShapeTileRenderer is busy while it draws a tile, and ShapeTiler adds its route. Circle, polyline and polygon tilers expose it internally, and BaseMapViewController.overlayTileActivity(kind) (@InternalMapConductorApi) lists a map's tilers of one kind, for the compose collections' onAddStart / onAddEnd to wait for the tiles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #57 (on #56, on #54). Merge those first; this one then retargets.
Pairs with MapConductor/android-sdk-compose, which uses this to call
onAddStart/onAddEndwhile tiles are being drawn.Why
A collection's
onAddEndcame when its new states' tiles were handed to the map. The slow part comes after that: drawing the tiles. A filter that only hides states, or a camera move to undrawn tiles, called nothing at all, so an app could not show that the map was still drawing.What
TileActivity: a counter that is busy while aShapeTilerroutes a list, or itsShapeTileRendererdraws a tile. It exposesactive: StateFlow<Boolean>.ShapeTileSet,CircleTiler,PolylineTilerandPolygonTilerhold it (internal).PolygonTilerkeeps its tile set for this.BaseMapViewController.overlayTileActivity(kind)lists those flows for circles, polylines or polygons.No public API change. The extension is
@InternalMapConductorApiand the members areinternal, soapiCheckpasses. 451 tests pass.