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

Android: too many state updates prior to rendering #7536

Closed
kkaefer opened this issue Dec 23, 2016 · 3 comments
Closed

Android: too many state updates prior to rendering #7536

kkaefer opened this issue Dec 23, 2016 · 3 comments
Assignees
Labels
Android Mapbox Maps SDK for Android bug performance Speed, stability, CPU usage, memory usage, or power usage

Comments

@kkaefer
Copy link
Member

kkaefer commented Dec 23, 2016

On Android, we seem to be doing way too many state updates: I'm seeing 30+ calls to setScalePoint with minor differences, which are followed immediately with a call to update() (meaning we recalculate the style + tiles, a relatively expensive operation). We should track down the source that leads to setScalePoint being called to many times within one frame.

@kkaefer kkaefer added Android Mapbox Maps SDK for Android bug performance Speed, stability, CPU usage, memory usage, or power usage labels Dec 23, 2016
@tobrun tobrun added this to the android-v5.0.0 milestone Dec 24, 2016
@tobrun tobrun self-assigned this Jan 4, 2017
@tobrun
Copy link
Member

tobrun commented Jan 4, 2017

I'm able to trace that this comes from MapGestureDetector#onScroll while we pan the map. I'm now looking into limiting the amount of updates we pass to core. This will require us to keep state of the amount of pixels scrolled in x,y and time the duration since previous moveBy.

@tobrun
Copy link
Member

tobrun commented Jan 4, 2017

One thing I'm also noticing is that setScalePoint is called multiple times after the gesture has finished. Those updates are originating from somewhere else.

UPDATE: these occurrences come from fling, it seems that it's possible to trigger a fling gesture just by scrolling and lifting up your finger. It passes in a small x,y difference to moveBy with a duration of 350ms. The usage of duration here seems to trigger multiple calls to setScalePoint.

@tobrun
Copy link
Member

tobrun commented Sep 19, 2018

A lot has moved since 2016, please reopen if still an issue. Closing as stale.

@tobrun tobrun closed this as completed Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android bug performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

No branches or pull requests

3 participants