4 ms·
valgrind had a bunch of stuff like massif, callgrind and memcheck but none of them (AFAIK) tell you how long a function call took, and point out the area of cod
by aksx 10y ago
valgrind had a bunch of stuff like massif, callgrind and memcheck but none of them (AFAIK) tell you how long a function call took, and point out the area of code taking too much time, which perf does.
- kazinator 10y agoYears ago I made a little C++ class for this. You could declare { tracer tr(function, ...) timer ti(tr, milliseconds); the constructor of the timer would sample and record the time. The destructor would sample the time again, and if it was over the specified milliseconds, it would log a diagnostic into the tracer.
- JDevlieghere 10y agoIndeed, because this wouldn't make much sense given the tenfold slowdown. Callgrind collect information about how many instructions were executed and who has been calling who. It's just a different profiling metric. I love valgrind/callgrind and it has proven extremely valuable. As always, choose the right tool for the job.