Open compnerd opened 1 year ago
The product reason for making this change: Reducing relocations that need to be resolved on startup should help improve application startup time and can also improve runtime performance by making high frequency, small Foundation calls less expensive.
@darinf I don't think it is as simple as that :). The static linking can increase code size, evicting useful cache lines more aggressively. CMO already gives you some of the benefits that you are thinking about with the high frequency small calls to Foundation.
Fewer relocations are of course always nicer but this does come at the cost of not being able to share pages and increasing memory pressure.
We currently cannot use
-static-stdlib
on Windows as the toolchain assumes that the standard library is always dynamically linked. This matches the behaviour of Darwin, but we should resolve the issues even if it is preferable to distribute the standard library as a shared entity.Known issues: