Live data from Hacker News

Ask HN: What's your best C/C++ profiling tool, hints and best practice?

news.ycombinator.com

11–13 of 13 posts

Re: Ask HN: What's your best C/C++ profiling tool, hints and best practice?

#11
post #6

HPCToolkit and TAU are good options for profiling C++ applications. They come from HPC so they are intended for use with parallel and highly concurrent applications. http://hpctoolkit.org/ https://www.cs.uoregon.edu/research/tau/home.php

Threadspotter (paratools.com) and maqao.org might be of interest, at least for x86_64 GNU/Linux but I wouldn't know about C++ specifics.

[TAU is doubtless a good bet, but for what it's worth for general interest, the other common systems for HPC are openspeedshop.org, cube/scalasca (scalasca.org), and extrae/paraver (bsc.es). A good comparison of them all would be useful, but I've not found one.]

Re: Ask HN: What's your best C/C++ profiling tool, hints and best practice?

#12
Before you start, determine what you are attempting to optimize. Throughput or latency? Improving averages, or reducing how often below-acceptable performance occurs?

Write end2end tests that execises the application as close to what user would. Then, use a profiler with an API so you can start dump when test/app setup is completed (to avoid extranous noise/misleading data). I like gperftools combined with KCachegrind as a GUI. Used it very successfully for instance in MyPaint: http://www.jonnor.com/2012/11/improved-drawing-performance-i...

Re: Ask HN: What's your best C/C++ profiling tool, hints and best practice?

#13
Your question is a bit all over the map - are you interested in reducing CPU usage, reducing time spent in locks, or do you want to talk to the kernel more efficiently? Are you targeting, throughput, latency?

That said, http://www.brendangregg.com/flamegraphs.html is a nice introduction to a site that has lots of material.

Post reply on HN