Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I've used a few profilers in the past and never found them particularly easy. Maybe I picked bad ones, maybe I didn't really know what I was expecting! But I'd like to know if there are any 'standard' profilers which simply drop in and work? I don't believe I need massively fine-detailed reports, just to pick up major black-spots. Ease of use is more important to me at this point.

It's VC++ 2008 we're using (I run standard edition personally). I don't suppose there are any tools in the IDE for this, I can't see any from looking at the main menus?

like image 752
Mr. Boy Avatar asked Apr 12 '10 19:04

Mr. Boy


People also ask

What is a profiler C?

The C Profiler tool enables the collection and display of execution profile data on C software source code bases of arbitrary size. It is a member of SD's family of Profiler tools.

Which is a profiling tool?

You can use profiling tools to identify which portions of the program are executed most frequently or where most of the time is spent. Profiling tools are typically used after a basic tool, such as the vmstat or iostat commands, shows that a CPU bottleneck is causing a performance problem.

Does Visual Studio code have a profiler?

Open the Performance Profiler by choosing Debug > Performance Profiler (or Alt + F2). For more information on using the CPU Usage or Memory usage tool in the Performance Profiler vs. the debugger-integrated tools, see Run profiling tools with or without the debugger.

What is code profiling tool?

Code profiling tools allow you to analyze the performance of your code by measuring the time it takes your methods to run and the amount of CPU and memory they consume.


1 Answers

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.

like image 54
Michael Myers Avatar answered Nov 15 '22 21:11

Michael Myers