What’s a very easy C++ profiler (VC++)?

I suggest a very simple method (which I learned from reading Mike Dunlavey‘s posts on SO):

Just pause the program.

Do it several times to get a reasonable sample. If a particular function is taking half of your program’s execution time, the odds are that you will catch it in the act very quickly.

If you improve that function’s performance by 50%, then you’ve just improved overall execution time by 25%. And if you discover that it’s not even needed at all (I have found several such cases in the short time I’ve been using this method), you’ve just cut the execution time in half.

I must confess that at first I was quite skeptical of the efficacy of this approach, but after trying it for a couple of weeks, I’m hooked.

Leave a Comment