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

Binary size violates the you-do-not-pay-for-what-you-do-not-use principle. #41177

Closed
typeless opened this issue Apr 10, 2017 · 2 comments
Closed

Comments

@typeless
Copy link

typeless commented Apr 10, 2017

I am evaluating a use case of Rust on an embedded system after playing with it occasionally as hobby. We currently use Go for it and it works great. However, we have to adopt a 'busybox'-like approach to deal with the binary size problem as the number of our small CLI tools growing.

I tried Rust but the outcome regarding binary size was disappointing. A hello-world program with a single dependency (clap) resulted in a 5.x MB executable, which has been already more monstrous than the aforementioned Go application we developed. And the Go executable doesn't even link to any shared library.

I am aware of the 'tricks' found by someone and the blog posts that help with the problem, but it works only for the Nightly, which isn't a good sign for uses in production software. And most importantly, the small binary should be the default for release builds and users only pay for the binary size bloating if the "additional" features are actually utilized.

Not sure If this is a realistic demand to Rust. Hopefully we don't have to stick to C forever when binary size matters.

@hanna-kruppe
Copy link
Contributor

It's hard to tell at a distance if the bloat is only due to jemalloc being used by default (and requiring nightly to opt out), or if there are other factors at play too. But at least for the jemalloc issue, there are plans to make the system allocator the default, see #36963 — unfortunately currently stalled.

@steveklabnik
Copy link
Member

Hi @typeless !

We care about this issue, but we also try to keep the bug tracker for specific, actionable bugs. All of those things relating to binary size (including the unstable bits) already have issues open. As such, I'm going to give this one a close. General discussions about developing Rust should happen on https://internals.rust-lang.org/. Thank you!

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

3 participants