|
From: Nicholas N. <nj...@ca...> - 2002-10-18 09:35:09
|
On Fri, 18 Oct 2002, Josef Weidendorfer wrote: > > if (!active) > > return; > > I'm not so sure about this. Cachegrind does instrumentation for EVERY original > x86 instruction. Even the overhead of calling a C function can make a > difference, I suppose. Switching helper functions would be nice, but the C > calling overhead (saving/restoring registers on the stack) is still there. > OK, only benchmarking will help here. It's easy to do -- make the log functions empty, time it, then remove the calls to the log functions, time it again. I've done this before and found the overhead of the C calls alone (argument passing, register saving, etc) to be significant for Cachegrind, eg. something like 20%. C calls have been optimised since then with liveness analysis, the use of ((regparm(n))) attribute, etc, so I would be interested in seeing it re-measured. N |