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 was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Android: too many state updates prior to rendering #7536
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.
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.
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.
Activity
tobrun commentedon 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 commentedon 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 commentedon Sep 19, 2018
A lot has moved since 2016, please reopen if still an issue. Closing as stale.