views:

163

answers:

1

There is a free tool called AppTimer-http://www.passmark.com/products/apptimer.htm. But i think it's not quite fit for my needs.

Windows provides a tool called xperf, is there a way to use it to test/benchmark application' startup?

A: 

If I'm helping to develop an app, and it gets too slow on startup (or any other phase), I just do this.

Common wisdom is that measuring performance of various routines is necessary for finding performance problems.

I go the other way - I locate the biggest problems (because their very slowness exposes them), and then I can roughly estimate how much time they take, if I care to. Here's an example of how it works.

The kinds of things I have found are, for example 1) fetching and converting strings from resources, which were in resources so that they could be internationalized, but did not really need to be internationalized, or 2) creating and deleting (along with serializing) deep data structures for no real reason in the process of setting up UI controls.

The things found are almost never what you might guess, so it is a mistake to guess. Just see what the process tells you.

The interesting thing about this is that the problem is almost never the kind of thing that profilers could easily tell you. The problem is nearly always some innocent-looking function or method call, somewhere in the middle of the call stack, that only gets your attention because 1) it shows up a lot, and 2) by looking at what it is doing and why, you can see that it can be done without. Getting rid of it saves as much time as it was on the stack.

Mike Dunlavey
If the C++ application running on windows, xperf connecting to MS public symbol server can analyze the root cause of slowing parts, it likes debuging.Thank you for your method.
Ali
@Ali: I can't count the times people have thought they had to buy, install, learn, make use of, and then puzzle over the output of a profiler, when I just hit the "pause" button on the IDE a few times and Bingo! there was the problem for all to see, and the PC was in Windows, but the fault was mid-stack, in our code. Happens every time. Every single time.
Mike Dunlavey