0

I am now developing a relatively large C++ program, which is composed of several functions. The C++ program will run these functions sequentially. What I want to know is how much time and how much memory each function would occupy. For the time consumption one solution is use the BOOST::Timer library. For the memory usage, however, I cannot find right library to do the job. I was wondering whether you have some ideas on this question. Moreover, does someone know some tools that can create a program efficiency report similar to MATLAB profile? Thanks!

feelfree
  • 11,175
  • 20
  • 96
  • 167

1 Answers1

2

You didn't specify your OS or compiler. What you want is generally known as a profiler. Using timer for profiling is not a good idea. For memory profiling look for "heap-profiler".

If available for your platform, I'd recomend valgrind's massif heap-profiler and optionally massif-visualizer.

http://valgrind.org/docs/manual/ms-manual.html

http://gitorious.org/massif-visualizer

Jan Spurny
  • 5,219
  • 1
  • 33
  • 47