views:

47

answers:

2

I'm looking for a good profiler for vs2008 professional edition, free or reasonably priced. I've already checked previous posts and tried about 8 profilers, but most of them are too basic or too detailed. Kindly suggest something, my requirements are as follows:

  1. It can be compiled, so that its well integrated with my application. I'm not shying away from instrumenting my methods.
  2. The output should be simple, i only need call count and time taken by methods and nothing else.
  3. I am mostly concerned about things INSIDE a method, you may call it line by line profiling. I want to select a method and know which line (expression / method call) is eating most of the time.
A: 

You could try to download an open source profiler (VerySleepy, LukeStackWalker) and see how they sample an application, and try to extract that logic.

Your application could then start a second thread, which does nothing more than sampling the main thread (or all the other threads).

Notice that in order to give readable results, your application should have access to the debug information (pdb file), either the file directly or via a symbol server. An alternative could be to just dump the addresses with their counters to file, and do the translation of an address to a function name in an external utility.

Patrick
+1  A: 

Maybe you consider it too basic, but if you want to know which lines of code would save you the most time by being optimized, the manual stack sampling method is very effective.

I would also suggest that point 2 (call count and time taken by routines) isn't exactly what you need, as in points 6 and 2 of this post. Rather, a line's percent-of-time-on-stack-during-the-interval-of-interest is the number that leads you straight to the "bottlenecks", and it does not need to be measured with high statistical precision.

Mike Dunlavey