4

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

Robert Gould
  • 68,773
  • 61
  • 187
  • 272
  • valgrind is more of an error finding tool. gprof is the profiling tool of choice for the GNU toolchain. – Evan Teran Nov 25 '08 at 06:14
  • @Evan: Boy, if **gprof** is the tool of choice, we've got a long way to go. http://stackoverflow.com/questions/1777556/alternatives-to-gprof/1779343#1779343 – Mike Dunlavey Nov 23 '09 at 21:06

3 Answers3

8

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

Adam Davis
  • 91,931
  • 60
  • 264
  • 330
  • 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 Nov 25 '08 at 05:45
3

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.

Zebra North
  • 11,412
  • 7
  • 37
  • 49
1

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

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135