4 ms·
Rust bundles its standard library, instead of having it in MSVCx.DLL. The println macro pulls in a lot of fancy formatting machinery. It also panics when stdout
by pornel 3y ago
Rust bundles its standard library, instead of having it in MSVCx.DLL. The println macro pulls in a lot of fancy formatting machinery. It also panics when stdout is closed, which pulls in panicking, debug print, and unwinding.
This is a one-time cost per executable. Projects for embedded systems typically disable these features to avoid the costs.
- tcfhgj 3y agoI created more complex programs with a much smaller size (without special optimizations) - up to date windows though
- kibwen 3y agoFor embedded work, you can take steps to make your Rust binaries much smaller. I know people who do demoscene in Rust. You can take that Hello World down to triple-digit bytes if such a thing matters for your use case.
- zozbot234 3y agoA useful reference: https://github.com/johnthagen/min-sized-rust https://github.com/johnthagen/min-sized-rust