Here I will post problems I and my colleagues met and solutions we found.

Friday, November 26, 2010

Performance in WPF

Recently we struggled with the performance of our WPF application. Everything was slow. Changing size of the window - slow, maximizing - slow, refreshing - slow. Then I looked at CPU - it was using CPU in idle. Something definitely wasn't right.

And then I found WPF Performance Tool

Using this tool I found that we had animation running in the background. We used it to indicate that something is going on when we do asynchronous calls, and then we hided animated elements with visibility. Well, even being invisible, animation continued to use resources, and very noticeably


My conclusions are:
1. Be very careful with animation. Especially if you run without expiration time, but wish to stop them manually, don't forget to stop them.
2. There are performance tools that can help. Particularly, I paid attention to the "frame rate", which helped me to identify my problem. The values should be close to zero when application is idle. If you are serious, learn these tools.

No comments: