This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Location animators memory and CPU optimizations #13678
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d782697
to
60dbe0c
Compare
0a5cd7c
to
6b5b350
Compare
tobrun
reviewed
Jan 30, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! one small comment and looping @danesfeder in for additional 👀
…ion rate throttle option
6b5b350
to
3e5e4ed
Compare
tobrun
approved these changes
Jan 30, 2019
3e5e4ed
to
246dbbe
Compare
danesfeder
approved these changes
Jan 30, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LukasPaczos awesome work here - excited to utilize these optimization in the navigation SDK ✅
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds an option to decrease the output rate of animated fractions for location camera's and puck's
LatLng
and bearing values and since on higher zoom levels those values do not need to be precise to still render visually correct, without animation "stuttering". Keeping the animation rate low decreases the CPU's utilization, which should directly impact energy consumption.Below are before and after screenshots of average CPU utilization while animating a navigation puck on zoom level
15
and tilt45
which are typical navigation settings for driving around town.Testing shows a CPU utilization on a Pixel 2 XL down about 11 percentage points on average - this is ~34% less CPU stress caused by our map and animations.
The higher we go with a zoom level the more we can throttle the animations. On zoom levels around 13, I could go down to as low as average 12% CPU utilization without impacting the UX.
In pair with decreasing the animation rate, this PR refactors the animator coordinator to only animate values that are going to be consumed - for example, camera bearing animator is not going to run if the
CameraMode
is set toTRACKING
only.Example usage:
TODO:
OnRenderModeChanged
listener