Marco van de Voort wrote:
and /or RAM usage?
Bigger, of course (on the order of a few hundred KB). Of course, this might also slow down execuution a little because of more cache misses, but this shouldn't matter much.
Afaik cache hits are better when compiled statically? This because unused code is stripped out?
This can be so. OTOH, if much library code is shared between executables (and especially in tha case of libc, there are always a number of executables using it running) and it's cached because of them, anyway ...
So I suppose it depends on the circumstances what the net effect is, but in most cases I guess it's smaller than the (little) speed-up gained by non position independent code (on the x86; there are other processors where all code is position independent).
The main disadvantages of static linking are slightly increased RAM usage and having to recompile if a serious bug in the library is found (while dynamically linked programs will use a new library version as soon as it's installed).
Frank