Skip to content
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

Significant iOS binary size increase with Rust 1.50 #907

Closed
data-sync-user opened this issue Jun 22, 2021 · 7 comments
Closed

Significant iOS binary size increase with Rust 1.50 #907

data-sync-user opened this issue Jun 22, 2021 · 7 comments

Comments

@data-sync-user
Copy link
Collaborator

As noted in mozilla-mobile/firefox-ios#8044 (comment), the v73.0.0 release of application-services has significantly increased compiled binary size (by nearly 30%, from 35M to 45M).

Some of that increase is due to the inclusion of Nimbus, but actually the largest contributor seems to be the switch from Rust 1.43 to Rust 1.50. Here's the size of a local build of v73.0.0 done using Rust 1.50, which matches what we see in the release artifact:

[rfk] repos/mozilla/application-services (git)-[tags/v73.0.0] % du -hs Carthage/Build/iOS/MozillaAppServices.framework/MozillaAppServices                                                
 46M    Carthage/Build/iOS/MozillaAppServices.framework/MozillaAppServices

Here's the same when built with Rust 1.43, the toolchain we used for previous releases:

[rfk] repos/mozilla/application-services (git)-[tags/v73.0.0] % du -hs Carthage/Build/iOS/MozillaAppServices.framework/MozillaAppServices
 40M    Carthage/Build/iOS/MozillaAppServices.framework/MozillaAppServices

I confirmed that if I manually remove Nimbus from the build, we get back down to around 35M, which was approximately the size of the previous release.

@data-sync-user
Copy link
Collaborator Author

➤ Ryan Kelly commented:

(Which, +5M still seems like a lot for Nimbus to be honest, but that's a separate question...)

@data-sync-user
Copy link
Collaborator Author

➤ Dan Mosedale commented:

Random thoughts:

@data-sync-user
Copy link
Collaborator Author

➤ Dan Mosedale commented:

Other things to try:

  • look at the LLVM 10 and 11 release notes, see if anything is mentioned there, particularly stuff controllable from the command-line
  • look the LLVM 10 and 11 github issues and PRs for rustc, and see if anyone noticed this along the way

@data-sync-user
Copy link
Collaborator Author

➤ Dan Mosedale commented:

rfk since you've got both builds around, can you try running cargo bloat to see if it yields any interesting info?

@data-sync-user
Copy link
Collaborator Author

➤ Dan Mosedale commented:

If the problem is LLVM-upgrade-related, interestingly, LLVM12 has landed in nightly rustc ( rust-lang/rust#81451 ), so maybe that'll change things yet again...

@data-sync-user
Copy link
Collaborator Author

➤ Dan Mosedale commented:

LLVM links, including release notes ( https://releases.llvm.org/ )

@data-sync-user
Copy link
Collaborator Author

➤ Dan Mosedale commented:

cargo-bisect-rustc ( https://blog.rust-lang.org/inside-rust/2019/12/18/bisecting-rust-compiler.html ) might help us sort this out too...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants