Demi Marie Obenour wrote:
Valgrind is not helpful for profiling production workloads. It is
too slow and will not provide an accurate indication of where the
time is being spent. That requires a sampling profiler.
IMHO, Valgrind (with the Callgrind or Cachegrind profiles) has a pretty good
cost model. Is it slow? Yes, definitely. (Count up to a factor 50 slowdown
for CPU-bound code.) Does it tell you where the bottlenecks are? In my
experience, it does. I have even run entire JVMs through Valgrind Callgrind
in order to find bottlenecks in the native C/C++ JNIs. (It will not help
with the Java code, of course. You need a Java profiler for that.) It has
always found the problem spots, where fixing them made the program faster.
So, while I can understand the "too slow" part, I cannot agree with your
"will not provide an accurate indication of where the time is being spent"
assertion. It is quite the opposite: sampling will necessarily be less
accurate because it can only take snapshots at certain intervals whereas
Valgrind monitors the entire program execution at all times.
Kevin Kofler