views:

916

answers:

3

How do Window's programmers profile their native C++ code? On Unix/Linux you have gprof [thanks Evan] & valgrind (I personally used this one, although it's not a real profiler), and recently I'm on Mac and Solaris, which means I moved to dTrace. Now when I've had the need to profile on Windows in the past, like at my previous job, I used Intel's vtune, which is great, however it's commercial, and I don't have a license for private use, so I'm left wondering what's the standard (free is better) tool windows programmers commonly use?

Thanks in advance

+5  A: 

You should give Xperf a try - it's a new system wide performance tool that can drill down to a particular application and what exactly it's doing inside itself as well as what's it's asking of the OS.

It's freely available on the Windows SDK for Windows Server 2008 and .NET Framework 3.5 ISO:

  1. Install the SDK by downloading the ISO image, or using the Web based installer.
  2. Find the xperf MSI in the SDK's "bin" directory. It will be named xperf_x86.msi, xperf_x64.msi, or xperf_ia64.msi, depending on the architecture for which you install the SDK.
  3. You can then install the xperf tools from the MSI directly, or copy the xperf MSI file to another location and install it from there. For example, you could keep the MSI files on a USB key.

Source: Pigs Can Fly blog on MSDN.com

Just verified that the xperf msi will not install except on windows Vista or Windows 2007.

Adam Davis
Looks interesting indeed, now I only need to migrate to Vista... bet it could run on XP, but they just want to attract people to switching to Vista... anyways +1 and thanks
Robert Gould
Ah, yes, I neglected to mention that drawback...
Adam Davis
+1  A: 

I got AMD Code Analyst. It's free, and you don't need an AMD CPU ;)

It's a little basic compared to something like Intel's VTune, but the price is right.

MrZebra
+1 for free and doesn't require Vista.
Robert Gould
A: 

This link talks about Linux, but I use the same technique in MSVC and in C#.

Mike Dunlavey