3 ms·
The first call is through a function pointer to a symbol resolution function, in any subsequent call the function pointer has been patched to directly call the
by ahartmetz 2y ago
The first call is through a function pointer to a symbol resolution function, in any subsequent call the function pointer has been patched to directly call the desired function. Seems pretty good to me.
- kazinator 2y agoIt's pretty gross. The shared lib call keeps going through a stub in the procedure link table; only the stub has improved after the first call so that it doesn't have to keep fetching the address of the function via the global offset table. The details are architecture specific, but it has overhead pretty much everywhere. On top of that, a register is dedicated to pointing to the global offset table. It has to be saved reassigned and restored as the control flow path takes trips through multiple shared libraries.