-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rust package size has gone from 120MiB in 0.9 to 330MiB with master #12440
Comments
Some obvious wins that we can get (this is just the size of the rustlib/$target directory)
rlibs are generally twice the size of their corresponding dylibs, this is because they include object code ( |
@alexcrichton: We already had the rlib files in 0.9 with the LTO object code though. I'm not sure why the total size has gone up so much... it seems there's some duplication we could be killing off. |
I wonder if we really need both rlib and dylib in all situations? To me it sounds that rlib's include everything that a dylib includes, right? So in case a rlib exists, do we really need a dylib of the same name? |
Aha, we also appear to be distributing |
Sadly no, rlibs include uncompressed metadata (much faster to read) and bytecode (used in LTO).
If you're creating a dynamically linked executable or library, you'd have to convert rlibs to dylibs each time you link against them, and at some point you're going to need a dylib living somewhere on the system, so sadly I don't think that this will work. Inversely, I don't know of a way to link against a dylib statically, so we need the rlibs around for static linking. |
Two optimizations: 1. Compress `foo.bc` in each rlib with `flate`. These are just taking up space and are only used with LTO, no need for LTO to be speedy. 2. Stop install `librustc.rlib` and friends, this is a *huge* source of bloat. There's no need for us to install static libraries for these components. cc #12440
This regression is mostly fixed, although it's still way too big. |
…evink fix(diagnostic): Don't remove diagnostic with empty message Use " " as message if it is empty [discussion on zulip](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/empty.20diagnostic.20message) ![image](https://user-images.githubusercontent.com/49202620/171412661-9b9575e9-e71b-4b84-a5c0-00271548d50c.png)
…efault, r=llogiq Add new `manual_unwrap_or_default` lint This adds a new lint checking if a `match` or a `if let` can be replaced with `unwrap_or_default`. ---- changelog: Add new [`manual_unwrap_or_default`] lint
Both are providing support for static linking and link-time optimization. A 300% increase in size with no increase in scope of the libraries is quite bad. The standard library itself went from 39M to 42M but this can be explained by the added features and some cases of temporarily duplicated code like
Vec<T>
and~[T]
. I have not yet investigated the exact cause of the enormous increase in size.The text was updated successfully, but these errors were encountered: