You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
tldr We are doing too much work as part of our gesture interaction. This ticket scopes responsibilities, profiles gestures and proposes optimizations or link related tickets.
Responsibilities of gesture detectors
transforming the map
setup camera invalidation (notifying user about transformations)
validate and reset tracking modes if required
push gesture related telemetry events
validate using a focal point vs centre of gesture.
Scroll gesture trace
In below traces we have disabled Telemetry for ease of profiling.
Memory trace
Below a memory trace captured from a scroll gesture:
Most notable are the 42 allocation for CowIterator (used to iterate on MapChangeListeners to deliver map change events). Though also interested in CameraPosition as ArrayList iterators allocations.
CowIterator allocations
The way forward removing these allocations is with #8389.
ArrayList Iterator allocations
The source of this is updating InfoWindows. Every time the map transforms we need to update the infoWindow. InfoWindows are collected in a List and for this we need to create an iterator. Currently we create an iterator even if there aren't any InfoWindows on screen. Checking for !infoWindows.isEmpty removes iterator allocations from default behaviour.
CameraPosition allocations
Camera position allocations occur when we need to update components on top of the map + need to notify end users about transformation changes. The latter has become obsolete with the new camera change api in #8644. Need to investigate rewriting the invalidation part for it.
CPU Trace
In the trace above you can see 31.84% of the trace was spend on NativeMapView#render:
31.56 % was spend in c++ for rendering
0.29 % was spend on dispatching map change events and updating UI afterwards
Other gesture traces
TBA
The text was updated successfully, but these errors were encountered:
tldr We are doing too much work as part of our gesture interaction. This ticket scopes responsibilities, profiles gestures and proposes optimizations or link related tickets.
Responsibilities of gesture detectors
Scroll gesture trace
In below traces we have disabled Telemetry for ease of profiling.
Memory trace
Below a memory trace captured from a scroll gesture:
Most notable are the 42 allocation for CowIterator (used to iterate on MapChangeListeners to deliver map change events). Though also interested in CameraPosition as ArrayList iterators allocations.
CowIterator allocations
The way forward removing these allocations is with #8389.
ArrayList Iterator allocations
The source of this is updating InfoWindows. Every time the map transforms we need to update the infoWindow. InfoWindows are collected in a List and for this we need to create an iterator. Currently we create an iterator even if there aren't any InfoWindows on screen. Checking for
!infoWindows.isEmpty
removes iterator allocations from default behaviour.CameraPosition allocations
Camera position allocations occur when we need to update components on top of the map + need to notify end users about transformation changes. The latter has become obsolete with the new camera change api in #8644. Need to investigate rewriting the invalidation part for it.
CPU Trace
In the trace above you can see 31.84% of the trace was spend on NativeMapView#render:
Other gesture traces
TBA
The text was updated successfully, but these errors were encountered: