There are different tools depending on your platform. Most recently, I've used VTune (Intel) on Windows. In a previous job, I used (and helped develop) the DevPartner Studio performance tools (was NuMega, then Compuware, now Microfocus) on Windows. At my current job, they use Shark on the Macintosh. There are many other tools out there. A quick Google search of "performance analysis c++" turns up quite a few hits.