Open julianrex opened 4 years ago
Following on from https://github.com/mapbox/mapbox-gl-native-ios/issues/63:
Currently the release frameworks are NOT building with -flto
or -Os
, which has resulted in an increase in binary size. Here are some stats when building with various optimizations.
Build settings | framework size 1 | dSYM size 2 | arm64 slice size 3 | arm64 no bitcode 4 | arm64 stripped 5 | __TEXT 6 |
__DATA |
__OBJC |
others |
---|---|---|---|---|---|---|---|---|---|
5.8.0 | 148065160 | 639619389 | 62868360 | 10439560 | 5162968 | 4800512 | 245760 | 0 | 116696 |
-Os -flto |
85817300 | 344712182 | 38254548 | 4241364 | 4241364 | 3883008 | 245760 | 0 | 112596 |
-Oz -flto |
72817804 | 325747720 | 31759500 | 3579020 | 3579020 | 3211264 | 245760 | 0 | 121996 |
Looking at compiling with -Os -flto
, the framework size is brought back to original levels - though when compiling with -Oz
the result is even more dramatic (~30% size reduction).
I would suggest that we update with -Os
, then compare performance when compiling with -Oz
("outlining").
Symbols should be included the dSYM; though the size is much smaller compared with 5.8.0
so I suspect I made an error with the symbol handling. Need to check debugging, and call stacks on crashes.
These stats were built from the jrex/build-tests branch building with make iframework BUILDTYPE=Release BUILD_DOCS=false
Notes:
framework
directoryMapbo.framework.dSYM/Contents/Resources/DWARF/
directoryarm64
slice, extracted by: lipo Mapbox.framework/Mapbox -thin arm64 -output Mapbox-arm64
xcrun bitcode_strip Mapbox-arm64 -r -o Mapbox-arm64-no-bitcode
strip -Sx Mapbox-arm64-no-bitcode -o Mapbox-arm64-no-bitcode-stripped
size
on the above binary.Noting that we should consider a separate Github release artifact for the dSYM
and bcsymbolmap
files (see also https://github.com/mapbox/mapbox-gl-native-android/pull/134).
Noting that we should consider a separate Github release artifact for the
dSYM
andbcsymbolmap
files (see also https://github.com/mapbox/mapbox-gl-native-android/pull/134).
Note that Carthage (#143) expects the .dSYM to appear in the same .framework.zip archive as the executable.
Note that Carthage (#143) expects the .dSYM to appear in the same .framework.zip archive as the executable.
Ok, so multiple packages ðŸ˜
Have split out the update of Release
and RelWithDebInfo
configuration into a separate PR: https://github.com/mapbox/mapbox-gl-native/pull/16460, so that existing build scripts/packaging is not changed.
I think it's still valid to consolidate configurations to just Release
& Debug
, so this ticket can be kept open for the time-being.
mapbox-gl-native
is simplifying the build configurations, to justDebug
andRelease
(see https://github.com/mapbox/mapbox-gl-native/pull/16083).We need to do the same.
We can handle a "stripped" build (i.e. what is currently
Release
) as a packaging step, i.e. by default the newRelease
configuration will contain debug symbols.At the same time we should consider #22