3 ms·
It seems like this blog post is not very well thought out. At least the Rust version was compiled in debug mode, binaries were not stripped, the size-optimizing
by dthul 6y ago
It seems like this blog post is not very well thought out. At least the Rust version was compiled in debug mode, binaries were not stripped, the size-optimizing compiler profile was not used and neither was LTO.
This repository contains information on how to achieve small Rust binaries: https://github.com/johnthagen/min-sized-rust https://github.com/johnthagen/min-sized-rust
- saagarjha 6y agoSome of those are useful, many are absolutely awful from the viewpoint of leaving in debugability.
- Alupis 6y agoAnd will anyone recognize all the absurd amount of hoops you must jump through to get small binaries with Rust? Some of which, as you said, remove features that are needed like debugging symbols.
- dthul 6y agoWhat's the difference to C++? Building with (the equivalent of) -Os, using LTO and stripping binaries are common approaches for reducing binary size, I don't see how this is absurd.
- Alupis 6y agoThose things can be used to produce smaller c++ binaries. Without doing a single thing, though, c++ binaries are tiny compared to a rust binary. That's the difference. To achieve small binaries with rust, one must remove nearly all the advantages of rust, including the self contained stdlib, debugging capabilities, and even runtime memory safety. What's even the point of using rust then?