C ++ profiling on Mac

I am writing only a C ++ application for STL only on Mac (OS X Lion / XCode 4.1). I need to answer a simple question: what parts of the code do I need to optimize? Gprof makes an empty output, Xcode Instruments does not help. Which tool do I need to use?

+7
source share
2 answers

Use a shark. It is located in /Developer/Applications/Performance Tools

Very easy to use. More details here: http://developer.apple.com/tools/sharkoptimize.html

+4
source

Even if gprof worked, it probably won't help.

The method I rely on for any language and OS is random suspension .

Here's how it works. If you take multiple samples of random time on the stack, wasteful function calls or I / O appear proportionally to the part of the time that they spend. This has the advantage that problematic statements are precisely defined, as opposed to hunting in expensive procedures.

0
source

All Articles