Why is there a performance difference when my application becomes activated?

cobbsjobs 96 Reputation points
2021-01-05T21:32:21.48+00:00

I am working on a WPF application that displays a grid of many images with scrolling/expanding animations that display a video when the user hovers the image.

When this application is run on an Intel CPU + NVidia GPU machine, the animations and video playback are very smooth at a maintained 60fps.

When run on a high-end AMD CPU + ATI GPU, the animations and video playback are noticeably laggy and the frames drop to ~30fps during animations/video playback. However - on these machines, the performance is if the user deactivates the application (e.g. alt-tabbing to another application) and then scrolls/hovers my program behind it to trigger the animations there are no frames dropped. Videos of a side-by-side comparison are linked at the bottom.

The Render Tier on both computers is 2, and enabling software-only rendering does not help address this.

When running a diagnostics session and performing the same animations on both Activated/Deactivated, the drop in frames spike is clearly seen Diagnostics: Red = Activated, Green = Deactivated. The UI thread does not appear to be exceeding 60%-70% at it's peaks,

Does anyone know why there would be a performance difference when my application becomes activated? The desired behaviour is for the animations/playback to always be smooth, as it is when the application is deactivated. It also does not appear to be very close to maxing out the UI thread either, and as far as I know, I have not written any specific tasks that only run if the application is activated.

Video of the scrolling comparison

Video of the MediaPlayer playback comparison

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,783 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
814 questions
{count} votes

Accepted answer
  1. cobbsjobs 96 Reputation points
    2021-01-13T03:30:50.28+00:00

    In the end it seemed to have more to do with the application being fullscreen.

    See how I fixed it

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.