3 ms·
The performance is way better. Callgrind/cachegrind operates as a cpu-level emulator (i.e. software emulating individual CPU instructions), while perf is a samp
by crazy2be 10y ago
The performance is way better. Callgrind/cachegrind operates as a cpu-level emulator (i.e. software emulating individual CPU instructions), while perf is a sampling profiler. This means you lose ~0 performance using perf, but at least ~10x performance using callgrind/cachegrind.
There is also the advantage that perf is really testing the actual code on the real hardware. This can get important if you are trying to design code that is cache-aware. Although, with cachegrind, you can set what kind of emulated cache parameters you want, I'm not sure how well this emulates the real hardware, especially if you have multiple threads with cache conflicts.