2

I'm looking for a measure performance tool for C (I'm using MinGW windows toolchain) that gives me some results like:

  • Occupied memory by a variable;

  • Cycles to run the program/a function;

  • Spent time on a function.

Thanks

rnunes
  • 2,785
  • 7
  • 28
  • 56

3 Answers3

2

Google Perftools is multi-platform: http://code.google.com/p/google-perftools/

GCC has profiling as well: How to use profile guided optimizations in g++?

Community
  • 1
  • 1
Chris Morgan
  • 2,080
  • 15
  • 19
0

You can use gprof with is shipped with GCC. Here are some examples.

You'll find more about that in the GCC documentation. Just remember that you must use the -pg option for both compilation and link.

However, I got that working, but only on small software. On the bigger one I work on, I only got empty timing, and couldn't find the cause of that. But maybe you won't have the same problem...

liberforce
  • 11,189
  • 37
  • 48
0

Usually when gprof does not give you results it is because it is a multithread application. gprof does not support this kind of apps.

Fermin
  • 1