Browse by Tags

All Tags » Performance (RSS)

PERFORMANCE: IEnumerable<>.Sum

Every once in a while you have to dig deep into your application and look for problems! I have a application that wasn't performing! After searching a bit I found my problem: I do a huge amount of queries and then sum some of the fields in these collections using the Sum extension method (System.Linq.Enumerable). This does make the code easier to read but I never realized the performance hit!!! To test this, I wrote a very simple application with a list of employees. class Employee { public int...

Scrolling Performance in WPF

With the beta release of .NET 3.5 SP1, scrolling received some much needed performance increases! Lets review first what we used to have and how it has now changed: The problem: This is a example of how a ListBoxItem can now look using WPF! Looks very nice... but it is very taxing... A item like this can contain 30+ UI Element! Imagine if I now have a list of 300 items x 30 UI Elements? It quickly escalates! The solution (Pre SP1): So, how do we reduce the amount of UI element to be created? VirtualizingStackPanel...