> Having a frequently called function in a shared library vs. statically linked code could mean the difference of the code executing from CPU's cache or from main memory.
I am under the impression that when process switches the CPU caches are flushed.