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!
            Asked
            
        
        
            Active
            
        
            Viewed 69 times
        
    1 Answers
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.
 
    
    
        Jan Spurny
        
- 5,219
- 1
- 33
- 47
