سؤال

I have a C++ based program up and running, my problem is that I would like to know:

  • what are the top10, top5, topX methods that are called the most
  • what are the heaviest classes for computation or what threads require the maximum clock cycles

it's possible to do this with tools like valgrind, perf or similar under Linux ?

I should not that this application uses many third part libs, but I'm not interested in those since what I want to modify and improve is the core of app itself so I can cut the list of all the possible methods down to the ones implemented only by the "real application".

In general how to detect what is the class or the method responsible for the biggest failures in branching and performance loss ?

هل كانت مفيدة؟

المحلول

You are looking for a profiler, such as gprof.

نصائح أخرى

The program you are searching for is called a profiler. It gives you a list of methods called and which percentage of your program running time they use. If you're under Linux you can use tools like valgrind, on windows I personally use Very Sleepy. You can also see this thread for a list of profiler under Linux: thread

to calculate machine cycle for a function or depth of a calls you can use QUANTIFY tool.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top