I was working with another guy a few days ago on a problem where the functions in his DLL were taking too much time to execute. I was able to let him know that it was his code by sticking QueryPerformanceTimer() around his functions, but couldn't give him more details than that.
He ran his code through some sort of performance analyzer and gave me a report with the weights of my DLL (which calls his and was built in release mode) and the most intensive 20-or-so functions in his side (built in debug). We had found an un-optimized function which was called a few thousand times per iteration and was sucking up all of our time. It took no time at all for him to optimize the function and reduce our execution time significantly.
I would also like to reduce the excecution time on my side. Does anyone know of any tools that would do the above? Even if it's only an analysis of entry point functions, I would really like something (putting 120 timers in my code takes too long). I'm running in Windows 7, with Visual Studio 2008.
A friend of mine once told me of a profiler he made for a project at work. IIRC, what he did was make some kind of macro and add it to the functions he wanted to profile. The macro did some IPC and/or networking in such a way that the net cost of using it was basically zero, because it happened inside the OS code, which had to run anyway. He used it to perform remote profiling and see in real time which things in a game made the frame rate drop and such.
Perfect! I checked out the screenshots and I think VerySleepy is exactly what I'm looking for!
gprof looked good, but the usage syntax looks linux-specific and difficult to incorporate into a visual studio compilation (although I could try manually adding the command-line arguments to the build-script).