I have problems with the performance of the UI of my WPF application on certain systems. On my developer system it performs just fine, on certain other systems however the performance is really bad. The problem occurs e.g. when moving splitters, resizing FlowDocuments or hovering over buttons.
The performance difference is not directly related to the obvious ‘specs’ of the computer. The application performs OK on a netbook (Intel Atom N550, 1GB RAM, Windows performance index: 2.0), but not on a desktop computer (I7 2600, 8GB Ram, ATI Radeon HD 5700, Windows performance index: 7.4). Both systems are running Windows 7. The application is build with .NET 4.0. I have tried to force software rendering using RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly. This however makes no difference at all.
What is causing this problem? How can I fix it?
This sounds like it might be the Wpf 4 bug we were stung by that affects apps with complex Wpf visual trees. It's discussed in this thread http://social.msdn.microsoft.com/Forums/en/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110. It even affected the Workflow 4 designer in VS 2010 - see http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/1f20c37f-1b9e-4b6d-904f-a6b518e4187a. According to that thread, there is a hotfix that you might want to try: http://support.microsoft.com/kb/2484841
You can get a good idea if this is the problem by attaching a debugger to your app when it is hung / stuttering and see if you see lots of UiAutomation InvalidateAutomationAncestors frames on the stack.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With