
Graham P. answered 05/28/19
Software Engineer and Student
The difference in runtime performance is often negligible. When choosing whether to statically or dynamically link an executable, there are often other trade-offs you're interested in. For example, if you're deploying an application diverse environments, eg many versions of an OS, you may want to statically link your executable, so you can deploy the compatible libraries with it. As for performance, if the performance critical section of code relies on many library calls, you may want to statically link the binary, then re-order blocks of code in order to increase performance. This is what you're referring to in (2). In general, indirection is expensive, the example (2) points this out.