3 ms·
25.8 KB zip file! Now that's tight code.
by daniel-cussen 8y ago
25.8 KB zip file! Now that's tight code.
- vbezhenar 8y agoI'm not sure that properly written C version would have bigger size (assuming that unnecessary code is stripped, of course).
- Drdrdrq 8y agoCurious: how does Rust cope in this regard?
- estebank 8y agoThey're on the bigger side, due to a combination of defaulting to static linking, some optimizations not having been possible (ThinLTO comes to mind), lots of debug strings and metadata, as well as the use of jemalloc[1][2]. [1]: https://jamesmunns.com/blog/tinyrocket/ https://jamesmunns.com/blog/tinyrocket/ [2]: https://users.rust-lang.org/t/rust-binary-sizes-once-again/16287 https://users.rust-lang.org/t/rust-binary-sizes-once-again/1...
- kbenson 8y agoYou're talking binary size, the zip file being referred to is the entire git repo in zip format. How large the Rust code would be is an interesting question. Interestingly, the repo notes the binary is only 6kb. I doubt C or C++ will get anywhere close to that.
- saagarjha 8y agoIf they're downloading the zip file from GitHub, then no, the zip only contains a snapshot of the current master branch.
- Thiez 8y agoWell if you only use libc like the assembly server does, I imagine you can use `#![no_std]`. Your Rust will use `unsafe` a lot and be very unidiomatic, but small. Is using the system allocator for binaries on stable yet?
- GyYZTfWBfQw 8y agoBut why?
- steveklabnik 8y agoNext release.
- coldseattle 8y agoThere it is!