-
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 platform size #61978
Comments
IIUC #59800 will reduce the size, potentially by a lot |
Also the comparison might want to include Haskell, whose installer is 268 MB (https://www.haskell.org/platform/windows.html). |
These comparisons are probably missing various aspects, e.g. Haskell includes the full haskell platform with a list of packages as well as a runtime. Rust might include other things... We should compare with our past selves first and foremost. |
@cup where are you getting that 205 MB number from? When I try to download https://static.rust-lang.org/dist/rust-1.35.0-x86_64-unknown-linux-gnu.tar.gz it tells me 252 MB so the problem is even worse than you say it is... Maybe linux vs windows? Some points for where the potential bloat could come from:
|
At least for Linux a lot of dependencies are linked statically (even libstdc++) to make it work on old Linux releases. |
@cup no need to wait for nightlies, the built artifacts are already being uploaded to public servers. This gives us the following size impact of #59800 :
Numbers collected via commands like So for rustc there is a nice sweet reduction but std has a massive size increase. @Zoxc why is this the case? Maybe some cache not being emptied? |
Hi, I have a question. What needs those rlib files in rust-std? Can I remove those rlib files from rust-std and have most crates build as normal? (I'm repackaging rust-nightly for Arch Linux.) It's 109MiB larger now and it'll take me four more minutes to download (what's worse, I can't watch online videos meanwhile).... |
There are some generic bloat problems that Rust has like #46477 which increase binary size which probably play into Rust's large platform size, too. |
Before #59800 a lot of symbols were placed into shared libs and duplication wasn't an issue. Using
Rust itself and the crates.
Some of the libs aren't necessary for every use case but they are relatively small. Big libs which are the issue here cannot be removed. It doesn't mean nothing can be improved. Multiple dependencies are built multiple times, it's clearly visible with EDIT: cc #57076 |
@mati865 thank you for the detailed response. However this part is concerning:
that seems to be "cutting at the branches rather than cutting at the root". To https://dl.google.com/go/go1.12.6.windows-amd64.msi Then Rust is 294 MB: https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.msi thats nearly 2.5 times larger. I know every language is different but this |
It's not the solution by any means, I just wanted to make people aware of better compressed archives.
Yes, it's concerning for sake of the completeness there is another big compiler. That said nightly to nightly it's over 100 MiB download size regression and there should be an effort on reducing it but there is no immediate solution. |
The two biggest are |
We could potentially replace the I've previously suggested this in #59800 (comment). |
I'm sorry for being dense, but what is the reason for having two copies of the compiler? That is, each distribution contains the duplicates |
But yes, that duplication is unfortunate. |
Can you explain more what purpose they serve for cross compilation? Targets which do not have host builds do not include a second copy of the compiler. Is it to support projects that link the compiler directly with |
Yes, you could cross compile something using rustc libs -- unstable, of course. But if #64823 goes through, we won't include this in |
I went to this page:
https://forge.rust-lang.org/other-installation-methods
and I discovered that the download is 203 MB. This was surprising to me, so I
looked at other languages:
So Rust is 70% larger than Go. Or to put another way, Rust is larger than Julia,
Python, PHP, D, Nim and Ruby combined. Can anything be done about this or is
the large size unavoidable?
The text was updated successfully, but these errors were encountered: