Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Profile gestures #9476

Closed
Closed

Description

@tobrun

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:

image

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

image

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

Activity

  1. added
    Android
    on Jul 11, 2017
  2. self-assigned this
    on Jul 11, 2017
  3. added this to the android-v5.2.0 milestone on Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Android

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions