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.

Android: too many state updates prior to rendering #7536

Closed

Description

@kkaefer

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.

Activity

  1. added
    Android
    performance
    on Dec 23, 2016
  2. added this to the android-v5.0.0 milestone on Dec 24, 2016
  3. self-assigned this
    on Jan 4, 2017
  4. tobrun commented on Jan 4, 2017

    @tobrun
    Member

    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.

  5. tobrun commented on Jan 4, 2017

    @tobrun
    Member

    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.

  6. removed this from the android-v5.0.0 milestone on Mar 6, 2017
  7. tobrun commented on Sep 19, 2018

    @tobrun
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Androidbugperformance

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions