Repository navigation
perf(updater): finite pulse for the update chip (#1554) - #1598
Merged
Merged
Conversation
An endless AnimationController.repeat keeps the engine producing a frame at the display rate for as long as a newer release is pending: an otherwise idle app burned ~30% of a CPU core (#1554). The chip now pulses for three breaths when it appears and then settles to its static colors, so the app is idle again. The pulse runs once per pending update and starts again only after the badge went away. Closes #1554
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The update chip used `_pulse.repeat(reverse: true)`, so while a newer release was pending the engine produced a frame at the display rate forever: ~30% of one CPU core in an otherwise idle app (measured in the issue; a `RepaintBoundary` did not help, the cost is the per-frame pipeline, not the chip repaint).
The chip now pulses for `kUpdateBadgePulseLegs` (6 legs = three breaths, ~8 s at Full motion, half of that at Reduced) and then settles to the static chip colors. The pulse runs once per pending update: re-syncs from the controller or a dependency change do not restart it, and it pulses again only after the badge went away (dismissed, installed, or a new update).
Off / OS `disableAnimations` behaviour is unchanged.
Tests (not run locally; CI will)
Not done here
The acceptance item for a `cpu_idle_update_badge` scenario in `benchmark/app_perf_bench.dart` (`/proc` CPU sampling on a profile build) is left for a follow-up.
Closes #1554