Profiling performance for Catel using ANTS Performance Profiler

by Geert 5. March 2012 21:56

Lots of people are very excited with Catel, but are somehow afraid that it will not perform because so much is possible and done automatically for you. Recently, we got a free license of the ANTS Performance Profiler for the efforts we put into Catel. We really appreciate it, and want to share our experience with profiling the performance.

Profiling the examples

The first thing we did was to profile the example applications. However, we couldn’t find any performance issues in the examples (even the larger ones). But, we have a work item to tackle the top 10 % most expensive calls, how to do that when all performance very well?

Well, we have a very large coverage of unit tests, so maybe we can profile these?

Profiling the unit tests

Now it really gets cool. I got the idea to profile our unit tests since it covers most of the (non-UI) API calls, so it would be a very good way to find the top 10 % worst performing methods. Then I stumbled upon this article. It tells in detail how to profile the performance using MSTest. How cool is that!

We use the following configuration to profile our unit tests:

image

After setting up the configuration, we only had to wait until all 1300 unit tests completed. I must admit it takes a while to run and analyze the results (appr. 5 minutes), but that’s a good time to get a cup of coffee. When we returned, we could select the part with the most red stuff and select it in the graph:

image

As we know, the binary redirect-serializer of Catel is the most expensive one (it allows you to change type names and assemblies when using binary serialization). It only costs much performance when the type system has actually changed, which happens in a “Convert to new format” wizard or something like that.

Anyway, it is very cool that we can now decide whether we want to put effort into this method and focus on what is really important for the users of Catel. For example, a validation sequence that takes 50 ms (that runs 5 times a second) has a higher priority than a once in a namespace changing redirect-serializer.

Conclusion

There are actually two conclusions:

  1. ANTS Performance Profiler rocks! How cool is it that when you cover everything using unit tests, you don’t need to test anything with a UI, but can simply run the unit tests. Maybe we can even integrate it into our continuous integration build and e-mail the top 10 % worst performing methods.
  2. While writing Catel, the team did an excellent job in keeping the performance in mind. We couldn’t find any real performance bottlenecks, so actually we are very, very happy with the results Smile

Tags: ,

Catel

Pingbacks and trackbacks (1)+

Comments are closed

About the Author

Geert van Horrik is an independent freelance software developer since January 1st, 2007. Since then he was been working on several projects from C++ to C# (WPF, Silverlight, ASP.NET, etc). Currently he loves to write his software using WPF (or Silverlight if WPF isn't an option).

Lately, Geert is spending a lot of time on Catel, a free open-source MVVM Framework for WPF and Silverlight. Actually, it's more than "just" an MVVM Framework, it's a complete application library!