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

MultiFingerGesture.isSloppyGesture Performance issue #14484

Closed
JRWilding opened this issue Apr 23, 2019 · 0 comments · Fixed by #14524
Closed

MultiFingerGesture.isSloppyGesture Performance issue #14484

JRWilding opened this issue Apr 23, 2019 · 0 comments · Fixed by #14524
Labels
Android Mapbox Maps SDK for Android

Comments

@JRWilding
Copy link

Steps to reproduce

  1. Perform a pinch to zoom gesture on a map with mapboxMap.uiSettings.isZoomGesturesEnabled = true

Expected behavior

Method is quick to return and doesn't churn memory.

Actual behavior

  1. Methods handling touch events (similar to draw methods) should avoid allocations as they are frequently called. metrics = new DisplayMetrics()
  2. Calls to get the display metrics are synchronized and can block - I've measured up to 4ms thread time (11ms wall) - e.g. windowManager.getDefaultDisplay().getRealMetrics()

As the comment suggests (line #143), this should be cached on touch down rather than called every move touch event
// As orientation can change, query the metrics in touch down

Configuration

Android versions: 6.0 -> 8.0
Device models: Pixel XL, Huawei P10, Samsung S7
Mapbox SDK versions: 7.3.x -> 7.4.0-beta.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants