-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.0: iOS release build is too large (has full symbols) #1824
Comments
@snej below is what I found (binary built from d70b7c1):
Use
From the above result, the bitcode takes 2/3 of the size. 6.3MB seems to be reasonable to me. |
I just noticed that the release |
Interesting. You're looking at a fully-fat library with all 4 architectures, but I'm looking at just the ARM binaries in iphoneos. I'm not familiar with the process we use to merge the binaries in 2.0; does it also strip anything? Because your 4x-fat binary is much less than twice the size of my 2x-fat one and contains half the number of total symbols, so it's clearly not just a merge of the device and simulator binaries. |
The build_framework.sh doesn't do anything special. Build Frameworks https://github.com/couchbase/couchbase-lite-ios/blob/feature/2.0/Scripts/build_framework.sh#L94 Merge Frameworks https://github.com/couchbase/couchbase-lite-ios/blob/feature/2.0/Scripts/build_framework.sh#L133 I could try to see what the different between running the xcodebuild command and using the xcode. Is it possible that it could be about XCode 8.3 vs 9? |
Wow, great discovery! I just tried defining STRIP_STYLE in the CBL xcconfig, and the MacOS binary size went from 1.74MB down to 1.36MB! That's ~380kbytes saved. (I don't know if it's worth doing this in the Mac version, but on iOS we should save a similar amount and it's totally worth it.) |
This configuration will stripped all non-global symbol, as a result it helps reduce the binary size. #1824
Close and open a specific one for Swift. |
As @borrrden points out, the CBL binary in Release/iphoneos is currently 15.7MB, which is way too large. By comparison, the current Mac binary is ~1.6MB. The iOS binary contains 32bit as well as 64bit, and it contains the LLVM bitcode, but it shouldn't be nearly that large.
I took a quick look, and one factor is that the binary contains symbols for everything, not just for exported functions. (To check, just run
nm CouchbaseLite.framework/CouchbaseLite
— currently it lists 14887 lines of symbols.)The text was updated successfully, but these errors were encountered: