An interesting issue I’ve been trying to figure out lately, why is WPF so blasted slow on my laptop? How slow? It takes 90 seconds to open a Hello World WPF app. Heck, it takes 90 seconds to load a WPF window with no “Hello World” or anything else for that matter. But to make life more interesting, if I was to load a WPF app that actually does something, like on of the Prism samples, it also takes 90 seconds to load.
I talked with one of my buddies who is a budding WPF expert who told me I was crazy and needed to get a psychologist. He is probably right. But something was telling me that this was a system problem, not a WPF problem. But for the life of me I wasn’t seeing it.
Every programmer needs a toolbox. Turns out there are several performance analyzing tools for WPF that ship with the Windows SDK. One of them is the WPF Performance Suite. While the tool is really cool…it didn’t help at all. If you want to check the performance of your WPF application while it is RUNNING, this tool will be great.
My problem was start up. Here was the breakdown: 60 seconds before I saw a WPF window, 30 seconds before anything displayed. After that, everything ran fine. Time for a different tool. Namely: Process Explorer from SysInternal (via Microsoft.com).
I was able to find my Hello World WPF application in Process Explorer (on my system, all .Net processes are colored yellow), then displayed the lower pane to display the DLLs used by the process. (BTW: I just confirmed that Windows Live Writer is a .Net application).
I found one interesting dll that was referenced: NCover. A while back I had installed a trial version of the commercial product (this was not the open source version). I have no idea what it was doing there, but it was there. In fact, it was referenced in every WPF application that I loaded — including WPF applications that I did not write, like the Subscription Center.
Long story made only slightly longer, I uninstalled NCover and now everything loads in about 10 seconds (a nine fold improvement), but I still don’t know what NCover was doing. If you know, please let me know.
One thought on “WPF startup vs NCover”
Comments are closed.