BucketSoft Blog

Insights and Inner Workings of a Micro-ISV


WPF is Like a Fat Super Hero

by SWortham 1. May 2009 02:15

It's slow to start up, but once it gets going it really moves.

For those that don't know, WPF stands for Windows Presentation Foundation. It is Microsoft's latest and greatest .NET Windows user interface development architecture, aimed to replace Windows Forms. Having built a fairly large Windows Forms app in .NET 2.0 Windows Forms before, I thought WPF would be an easy transition for me. That hasn't exactly been the case -- a lot has changed.

However, now that I'm a little more comfortable with WPF, I've come to certain conclusions about it. First of all, I'm loving the flexibility. In some ways it's like Flash development and I loved Flash development when I did it for a bunch of projects between 2001 and 2005. Being able to apply custom gradients, draw custom shapes and buttons, and animate objects all in vector form is pretty cool.

But to me the best thing about WPF, and the thing that I think often goes under-appreciated, is how it takes advantage of the GPU in your video card to off-load some of the UI processing from your CPU. As a former OpenGL 3D programming hobbyist, I can really appreciate the power of the GPU. My $100 video card at home has 112 cores each running at 1.5 GHz. That's essentially like 112 processors that (when I'm not playing a video game) are never used to their potential. So Microsoft has finally recognized how much processing power are in these massively powerful video cards that are now commonplace in even the most basic new PC's and they've made WPF take advantage of that. As a result, I can build an application with thousands and thousands of UI elements in large grids or whatever you can imagine and the computer can actually handle it while simultaneously ripping CD's. Parallel processing is sweet.

Of course, there is one little problem. It is slow to start up a WPF application after a fresh reboot. It's faster after subsequent launches, but on the first launch Windows typically has to start the font cache service because by default it is not configured to start automatically. I know that plays a big part in the slow start up but I'm sure there are other factors. To give you some idea of what I mean by slow, I'd say Data Comparisons Express typically takes around 5-7 seconds to start up after a fresh reboot on the computers I've tested it with. That may not sound like a terribly long time. But when you're a speed freak like me, it's an eternity. Especially considering the entire application fits into a 315 KB installer.

Apparently Microsoft has been working on this and made some big improvements in .NET 3.5 SP1. But it's still not fast enough. I hope they can improve it more, and improve it soon because other than that WPF really is a beautiful thing.

Tags:

Comments

9/17/2009 12:29:47 PM #

how to reduce the cpu usage ?

Sealey Tools United States |

9/21/2009 11:24:41 AM #

We are a group of volunteers and starting a new initiative in a community. Your blog provided us valuable information to work on.You have done a marvellous job!

payday loans United States |

9/23/2009 1:43:52 PM #

Wonderful article, thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here

chat software United States |

9/28/2009 3:31:48 PM #

ha...i like the name fat super hero....slow but gets the job done. yeah i agree i tried WPF and also thought it was a little slow...but glad the MS is taking care of it.Thanks for the post

weigh loss pills United States |

9/30/2009 4:39:50 PM #

That's a lot of lag time for such a small app.

Product Package Design United States |

9/30/2009 4:59:41 PM #

Thanks for the information about windows Presentation Foundation
and i m surely going to use it with my Windows Forms to see the power

ecommerce web design United States |

9/30/2009 6:08:04 PM #

WPF is Like a Fat Super Hero  , fascinated me. I have  started to develop utilizing Silverlight but I am realising it is a large learning curve.  My earlier experience is with php, mysql, most linux based tools and flash. The ambition of employing Silverlight to produce an acceptable page structure that runs rapidly in all the major browsers, Internet Explorer, Safari, Firefox and Chrome seems a big head ache that is taking me numerous hours to overcome.  Interesting to read your opinions and the comments in your website on Silverlight.  I feel the tutorial sites and Microsofts offering are inflexible and address the same items, discussion in web logs oftentimes references effective ways to beat issues which takes me through the learning curve more rapidly.  Thanks for the post, it has assisted in a small way to take me through the migration.

drainage United Kingdom |

Powered by BlogEngine.NET 1.5.0.7

About the author

My name is Steve Wortham, and I've been coding since I was 12 years old. My experience ranges from 3D programming to web design & development to Windows software development. It's always been a dream of mine to start my own software company and now it's happening.  I started BucketSoft, LLC in March 2009 as a Micro-ISV.  The rest, as they say, is history.