4 ms·
Are you sure? AFAIK the prediction will usually assume that the called address will be the same as the last one, so in an inner loop (eg. mapping a function ove
by ramchip 17y ago
Are you sure? AFAIK the prediction will usually assume that the called address will be the same as the last one, so in an inner loop (eg. mapping a function over an array), only the first call would take a long time, and then only by 20-25 cycles. If a loop is so tight that 5 or so cycles per iteration matters, there shouldn't be a function call in it in the first place.
(I've googled earlier and someone measured a virtual call in a tight loop to take about twice the time of a direct one. Intel doc says a call is about 5 cycles. That would mean an extra 5 cycles or so for the indirection.)