4 ms·
Function call overhead is on the order of several 10s of clock cycles (round to 100, not 10), or a few dozen nanoseconds. The actual impact of function calls is
by jcranmer 7y ago
Function call overhead is on the order of several 10s of clock cycles (round to 100, not 10), or a few dozen nanoseconds. The actual impact of function calls is usually not so much the overhead of the call itself, but rather on the fact that function calls tend to be barriers to analyses and optimizations.
Context switches are closer to about 1µs in the best case, with interprocess context switches maybe reaching 5µs. The time here is much more variable because the really painful thing is the effect of TLB flushing and other microarchitectural state going completely haywire.
- yjftsjthsd-h 7y ago> The time here is much more variable because the really painful thing is the effect of TLB flushing and other microarchitectural state going completely haywire. Isn't context switch also where spectre/meltdown mitigations hit the hardest, too?