• Post Calendar

    February 2015
    S M T W T F S
    « Dec   Mar »
    1234567
    891011121314
    15161718192021
    22232425262728

Charles Petzold Efficient ItemsControls

Headline: Charles Petzold did a great job showing some of the performance characteristics of various approaches of WPF (Windows Presentation Foundation) and here I show some of the resulting numbers on my computer.

In March 2009 Charles Petzold had an excellent MSDN article called “Writing More Efficient ItemsControls”. I’m not going to bother repeating that good information here.

#1 First Try

image

#2 Converters

image

#3 Presenter

image

#4 Custom Dot

image

#5 Custom ScatterPlot

image

#6 Better Custom ScatterPlot

image

Results

All these examples were run with 10,000 points. Below is a table that shows all those results plus the amount of memory used for each.

image

1 Million Points

Now all the above were done with 10,000 points. I only tried 1 million points with #6 and here were those results.

image

Of course it didn’t really come up that fast and the memory used was 1.8 GB RAM. That’s a lot. And despite what the numbers say, it took over 90 seconds for this to display.

Over 90 seconds for 1 million points to display!

So for lots of points, these techniques still don’t work well. But you can learn a lot from this set of code samples.

Leave a Comment