What's the Best Free C++ Profiler For Windows

What's the best free C++ profiler for Windows?

CodeXL has now superseded the End Of Line'd AMD Code Analyst and both are free, but not as advanced as VTune.

There's also Sleepy, which is very simple, but does the job in many cases.

Note: All three of the tools above are unmaintained since several years.

C++ Profiler on Windows

If you want to mesure how long the entire program run's, then Code-Blocks/Visual studio should
tell you when the program closes. It should be in the log at the bottom.

If you want to mesure how long a specific line, or function takes, I would suggjest researching
clock() or QueryPerformanceFrequency() and how to use them.

the clock() function is slow, but it's easyer to use. an example:

float start_time = clock()/CLOCKS_PER_SEC;
func();
float end_time = clock()/CLOCKS_PER_SEC;
float dtime = start_time - end_time;

What are some good profilers for native C++ on Windows?

On Windows, GlowCode is affordable, fairly easy to use, and offers a free trial so you can see if it works for you.

Free C++ profiler for Windows

I've never had to look for one (because I use MinGW and it has a profiler for free), and I've never used this one before, so I don't know if it has all the features you're looking for, but try this anyway?

Very Sleepy Profiler

Xperf from Windows Performance Analysis Tools

Hope this helps!

C and C++ source code profiling tools

I've found gprof to be the best CPU hotspot profiler, and Google Performance Tools to be the best sampling profiler. Both work for C and C++.

In my opinion there are no good profiling tools on Windows.

GNU gprof pros and cons

  • GCC only
  • Works with C and C++
  • Only treats CPU time, and code inside the binary, you need everything you wish to profile statically linked in
  • Very accurate
  • Adds a small overhead to execution

Google Performance Tools pros and cons

  • I think it requires the GNU tool chain
  • Occasionally fails to identify symbols
  • Very customizable
  • Outputs to a huge variety of formats, including the Callgrind format, and automatically loads KCacheGrind for you
  • Has various memory profiling tools also
  • Is a sampling profiler, with minimal overhead

Related useful questions and answers

  • Alternative to -pg with Clang?
  • What's your favorite profiling tool (for C++)
  • Alternatives to gprof
  • C++ Code Profiler
  • Confusing gprof output

Which has been the most reliable, fastest Windows C++ profiler that you have used?

When I have to profile realtime code, I think the only solution is something hand-rolled. You don't want too much coverage or you end up slowing the code down, but with a small data set, you need to be very focused, essentially picking each point by hand.

So I wrote a header file several years ago that defines some macros and a mechanism for capturing data, either as function timings or as a timeline (at time T in function X). The code uses QueryPerformanceCounter for the timings and writes the data into named shared memory via CreateFileMapping so that I can look at the timing data from another process live.

It takes a recompile to change what timing information I want to capture, but the code is so inexpensive that It has virtually no effect on the code.

All of the code is in the header file, (with macro guards so the code only gets included once). so the header file itself is my 'profiler'. I change some tables in the header, then and markup the target code, recompile and start profiling.

Decent profiler for Windows?

Intel VTune is good and is non-instrumenting. We evaluated a whole bunch of profilers for Windows, and this was the best for working with driver code (though it does unmanaged user level code as well). A particular strength is that it reads all the Intel processor performance counters, so you can get a good understanding of why your code is running slowly, and it was useful for putting prefetch instructions into our code and sorting out data layout to work well with the cache lines, and the way cache lines get invalidated in multi core systems.

It is commercial, and I have to say it isn't the easiest UI in the world.

Free profiling in C++?

  1. AMD Code Analyst
  2. Sleepy

A little googling gives a impressive list of freebies(disclaimer: I haven't used these):

  1. Shiny
  2. Google Test
  3. Windows Performance Analysis

Hth.



Related Topics



Leave a reply



Submit