Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling C code on Windows when using Eclipse

I know I can profile my code with gprof and kprof on Linux. Is there a comparable alternative to these applications on Windows?

like image 927
Pieter Avatar asked Feb 20 '10 14:02

Pieter


2 Answers

Commercial software:

  • Rational Quantify (expensive, slow, but very detailed)
  • AQTime (less expensive, less slow, a bit detailed)

Free software:

  • Very sleepy (www.codersnotes.com)
  • Luke StackWalker (lukestackwalker.sourceforge.net)

These commercial alternatives change the compiled code by 'instrumenting' (adding instructions) to it and perform the timing withing the added instructions. This means that they cause your application to slow down seriously.

These free alternatives use sampling, meaning they are less detailed, but very fast. In practice I found that especially Very Sleepy is very good to have a quick look at performance problems in your application.

like image 190
Patrick Avatar answered Nov 01 '22 03:11

Patrick


There's a MinGW port of gprof that works just about the same as the Linux variant. You can either get a full MinGW installation (I think gprof is included but not sure) or get gprof from the MinGW binutils package.

For Eclipse, there's TPTP but it doesn't support profiling C/C++ as far as I know.

like image 3
AndiDog Avatar answered Nov 01 '22 04:11

AndiDog