Skip to content

Fix high GPU usage from always-running indeterminate ProgressBar animations#5061

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/indeterminate-progressbar-gpu
Jul 8, 2026
Merged

Fix high GPU usage from always-running indeterminate ProgressBar animations#5061
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/indeterminate-progressbar-gpu

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

The cause is that every indeterminate ProgressBar in the app was declared with a static IsIndeterminate="True" and only toggled via IsVisible (or Opacity). An indeterminate bar runs an infinite animation, and that animation clock keeps running for the control's entire lifetime — hiding the control doesn't stop it. A live animation keeps Avalonia's compositor render loop producing a new frame at the display's refresh rate instead of going idle.

By itself that's cheap. But on a transparent Mica window the compositor loses cheap partial (dirty-rect) presents — each committed frame forces a full-window present plus a DWM blend against the backdrop. On a high-refresh, high-DPI laptop panel driven by an integrated GPU, doing that 120–165×/second is what spikes GPU usage.

Fix

Bind IsIndeterminate to the same flag that controls the bar's visibility, so the animation clock actually stops when the bar is hidden and the render loop can go idle.
this fix dropped the GPU usage to 0.1% on my computer when idle

@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit 49ac912 into main Jul 8, 2026
3 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the fix/indeterminate-progressbar-gpu branch July 8, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants