C++ Binary Size Increase in Xcode 16 Compared to Xcode 15

I've recently upgraded my project from Xcode 15 to Xcode 16. Without changing any build settings or compiler flags, I noticed that the final executable size has increased significantly when building the same C++ code.

Investigation: To investigate further, I compared the Link Map outputs from both versions of Xcode. One key difference I found:

The symbol size for std::sort increased from 4,336 bytes (Xcode 15) to 6,084 bytes (Xcode 16) – a ~40% increase.

This seems to be part of a broader trend where other standard library symbols are also taking up more space in the binary when built with Xcode 16.

Questions:

  1. Has Apple Clang or libc++ in Xcode 16 changed the implementation of STL algorithms like std::sort?

  2. Are there changes in inlining, template instantiation, or debug info that could explain the increase?

  3. Is this expected behavior? If so, is there any guidance on minimizing the binary size regression?

C++ Binary Size Increase in Xcode 16 Compared to Xcode 15
 
 
Q