-
Notifications
You must be signed in to change notification settings - Fork 420
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
Reduce framework size #1329
Comments
Can I recommend stripping the app binary? Much of the size is likely to be symbols, and these can easily be removed by stripping them. Otherwise, you can try enabling |
-0size doesn't help. It reduced app clip size from 9.4 mb to 9.3 mb) |
Tried switch from SPM to Cocoapods and AppClip uncompressed size increased from 9.4 mb to 11.5 mb 😨 If change |
Have you tried stripping the binary? |
App clip size with
a) [-O] b) Swift compiler: [-Osize], Apple clang Optimization level: [-0s] c) Swift compiler: [-Osize], Apple clang Optimization level: [-0z] Don't know what can I do else to reduce grpc lib size |
Thanks @Banck. Can you run the |
|
Hah, sorry, can you remove the symbol stripping before you do this? That data is not all that useful without the symbols, as all we can tell is that we're using the code size mostly with code. I also want to point out apple/swift-protobuf#1204. |
Disabled Bitcode and applied these settings:
App size: 7 MB compressed, 26,3 MB uncompressed let me know if I did something wrong or if something needs to be done additionally. Thank you |
When I wrote the first message, I measured app size, then integrated grpc with 1 simple proto file, and measured again. The size difference was around 6.5 mb. |
Is it possible for you to compare with only the impact from swift-protobuf? I'd like to isolate how much is grpc-swift. Keep your |
I measured app size with bitcode and stripping and integrated grpc via SPM: Then removed all services, generated before and generated only models via comand:
App size: 3,1 MB compressed, 7,1 MB uncompressed b) added these libs: App size: 3,3 MB compressed, 7,5 MB uncompressed |
And sure, only with SwiftProtobuf: |
Ok, so based on those numbers, the big code size contributor appears to be |
For my own future reference:
This sure implies that NIO is the bulk of the weight. NIOCore should not be that heavy, but NIOPosix may well be. |
Yes, I do import NIO and import NIOCore in my services, because grpc returns EventLoopFuture and I working with it, which is part of swiftNIO. |
7.5 mb - it's without grpc. |
@Banck It's part of SwiftNIO, but we recently split the Now, unfortunately grpc itself still requires |
I've noticed, that through SPM I can install grpc without swift-nio-ssl, cause Package.swift contains:
And this allowed us to reduce the size of the application by 1.5 mb If install grpc through cocoapods app size is I just wonder how can install |
Hello.
We are using grpc in project, which has App Clip,so that’s why we care about the size of the application (there is limit of 10 mb of uncompressed app).
grpc integration (via spm) increased uncompressed app size by about 6.5 mb.
Maybe there are any solutions to reduce framework size?
Thanks.
The text was updated successfully, but these errors were encountered: