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.
iOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOSnavigationFor the Mapbox Navigation SDK for Android or iOS or navigation use cases in generalperformanceSpeed, stability, CPU usage, memory usage, or power usage
If you attempt to change the camera to an mbgl::CameraOptions that’s identical to the current CameraOptions, mbgl::Transform still goes through the entire animation machinery. We do avoid modifying the TransformState in that case, but by then it’s too late: we’ve already kicked off an animation timer and all the calculations for each step of the animation. The animation timer updates the map on a schedule regardless of whether the transform state changes.
There are multiple places where we can short-circuit the animation, and we should consider all of them to avoid severe energy consumption in navigation use cases, which require constant animation.
Incidentally, when we bail for a no-op animation, should the completion callback by called immediately, or still on a delay?
Beginning in 4ef336e I am gating each viewport change method on MGLMapView (center, zoom, direction, bounds, camera, etc. with or without padding) by checks to bail early (possibly immediately running a passed completion callback in the main thread) before attempting any further mutation of the viewport state.
I also abstracted some routines out that we use more than once and created a set of convenience handlers for checking the viewport changes by passing some or all of these parameters.
The fix in 4ef336e will harden us against this kind of issue, but it should be much more tightly scoped to take advantage of the equality functions we already have in the SDK. Every round trip between MGLMapCamera and mbgl::CameraOptions loses accuracy when the map is tilted, due to #2259.
@1ec5@friedbunny@boundsj I'm trying to think ahead to how I might write tests for these gates and coming up blank. Basically, we want to ensure that the setters are bailing early if the viewport is unchanged. By virtue of the viewport not getting changed, there isn't really anything to measure concretely.
Because there would still be some knots (like the KVO willChange/didChange calls) to untangle so close to a release, with the risk of regressing delegate method coalescing that we've been unable to UI test reliably. Also because the right fix in mbgl has implications for the Android SDK, which is even closer to release. See #5833 (comment).
This issue – insignificant camera changes that trigger animations in-place – is most likely an edge case that only occurs for instance when the user is stopped at a traffic light and GPS readings bounce around slightly.
#7236 is related and much more acute. We’ll have to do a bit more profiling to know exactly where the issue lies.
iOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOSnavigationFor the Mapbox Navigation SDK for Android or iOS or navigation use cases in generalperformanceSpeed, stability, CPU usage, memory usage, or power usage
Activity
tobrun commentedon Aug 12, 2016
I think from end user perspective immediately would make the most sense.
incanus commentedon Aug 16, 2016
I am going the route here of:
I'm doing this with a few reusable viewport and camera equality check routines and some other slight refactoring to ensure that:
Starting with iOS to hit some immediate needs, but will bring this to Android as well.
refs #5983: gate all viewport changes with equality check first
incanus commentedon Aug 16, 2016
Beginning in 4ef336e I am gating each viewport change method on
MGLMapView(center, zoom, direction, bounds, camera, etc. with or without padding) by checks to bail early (possibly immediately running a passed completion callback in the main thread) before attempting any further mutation of the viewport state.I also abstracted some routines out that we use more than once and created a set of convenience handlers for checking the viewport changes by passing some or all of these parameters.
This is just iOS to start.
/cc @1ec5 @friedbunny
refs #5983: properly fill out bounds rectangle
refs #5983: abstract reusable convenience converter
1ec5 commentedon Aug 17, 2016
I think this is the cruxt of the problem that’s currently affecting user tracking use cases and causing #5833.
The fix in 4ef336e will harden us against this kind of issue, but it should be much more tightly scoped to take advantage of the equality functions we already have in the SDK. Every round trip between MGLMapCamera and
mbgl::CameraOptionsloses accuracy when the map is tilted, due to #2259.incanus commentedon Aug 17, 2016
@1ec5 @friedbunny @boundsj I'm trying to think ahead to how I might write tests for these gates and coming up blank. Basically, we want to ensure that the setters are bailing early if the viewport is unchanged. By virtue of the viewport not getting changed, there isn't really anything to measure concretely.
Any ideas?
🤔
incanus commentedon Aug 17, 2016
Specifically, it would be nice to be able to determine that either a Core Animation or a core GL transition aren't happening.
incanus commentedon Aug 17, 2016
Currently trying something around inspecting
_mbglMap->transform.inTransition().20 remaining items
1ec5 commentedon Nov 21, 2016
Because there would still be some knots (like the KVO willChange/didChange calls) to untangle so close to a release, with the risk of regressing delegate method coalescing that we've been unable to UI test reliably. Also because the right fix in mbgl has implications for the Android SDK, which is even closer to release. See #5833 (comment).
1ec5 commentedon Nov 30, 2016
This issue – insignificant camera changes that trigger animations in-place – is most likely an edge case that only occurs for instance when the user is stopped at a traffic light and GPS readings bounce around slightly.
#7236 is related and much more acute. We’ll have to do a bit more profiling to know exactly where the issue lies.
1ec5 commentedon Feb 18, 2017
Fixed for iOS and macOS in #7125 on the release-ios-v3.4.0 branch. #7295 tracks a similar issue on Android.