0

I'm using the gprof profiler to know the execution time of my functions and the performance of the code. The code is about face detection in C++ using the raspberry pi 2 and the camera module. i'm using gprof => what i get in output is :

Profiling output with gprof

i think of using manual memory management to reduce the execution time of my program what can you suggest for me NB: The program when executing is like an infinite loop that opens a window and capture frames continuously. The only way to exit is to press the "ESC" key. thanks for your help and if there is another profiler that i can use just tell me that :) code found here : https://github.com/Itseez/opencv/blob/master/samples/cpp/facedetect.cpp

Community
  • 1
  • 1
The Beast
  • 1,629
  • 2
  • 29
  • 42
  • Give [*this*](http://stackoverflow.com/a/378024/23771) a try. – Mike Dunlavey Jul 12 '15 at 19:22
  • Again, try [*the method I posted*](http://stackoverflow.com/a/378024/23771). If you want a crude video explication, [*look here*](https://www.youtube.com/watch?v=xPg3sRpdW1U). *gprof* has several deficiencies [*listed here*](http://archive.is/9r927). – Mike Dunlavey Jul 13 '15 at 10:30
  • ok so how can i look at the call stack , after i interrupt the program ?? – The Beast Jul 13 '15 at 14:05
  • 1
    You're under a debugger, right? Every debugger has a way to display the call stack. Like if the debugger is GDB, I hit Ctrl-C to interrupt it, then "thread 1" to get to the working thread, then "bt" (backtrace) to show the call stack. (By the way, compile the code in debug mode, with optimizations disabled. Do your tuning. Then when you've got it all cleaned out, turn the optimizations back on.) – Mike Dunlavey Jul 13 '15 at 14:22
  • 1
    ok i'll try this and let you know :) – The Beast Jul 14 '15 at 00:53

0 Answers0