WPF Application Start Up Time

When I run my WPF application in the ANTS Performance Profiler, it takes a very long time to start up. It takes roughly 4 times longer to start up in the profiler than it does in the debugger or from the console.

My main concern and reason for using the profiler at this time is to enhance startup time on my application, so this slowdown is making the use of the ANTS profiler useless in this case.

Is there some configuration that will help get my startup time to be more inline with what it should be?

Thank You

MEF

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Matt,

    I have noticed the same issue myself -- I think that the base reason for WPF startup being slowed down this noticably is that there are a lot of recursive methods. If you profile a WPF app, you will see some methods have a high hit count. The get_CurrentThread method will be in the hundreds of thousands, then the call graph shows some recursion in SubclassWndProc.

    Recursive methods have historically caused a performance hit for profilers.
  • Hi Brian-

    How can I profile down into these methods?
    Currently, the profiler just shows them collapsed without source.
    I assume this is where the framework stuff is sitting.

    Thank You for you help!
    MEF
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I just went to the "grid view" so that I could easily sort on the methods with the largest hit count.
  • Matt,

    if you want to see the collapsed methods then just change the display options - see the combo boxes.

    By default it shows "Top down, methods with source"

    Just change this to Top Down, any method.

    Be warned though - the noise of showing all these methods will be large. I would select the region of interest and switch to the All Method grid and change the display settings there too.

    S
Sign In or Register to comment.