2 ms·
In case you're binary-size-obsessed like me, here are some stats on that statically-linked musl "Hello, World" binary: $ size target/x86_64-unknown-linux-m
by haberman 10y ago
In case you're binary-size-obsessed like me, here are some stats on that statically-linked musl "Hello, World" binary:
$ size target/x86_64-unknown-linux-musl/debug/hello
text data bss dec hex filename
351471 10256 10064 371791 5ac4f target/x86_64-unknown-linux-musl/debug/hello
Here is a "Hello, World" C program statically linked against musl:
$ size test
text data bss dec hex filename
3380 248 1232 4860 12fc test
Looking at a size profile, about 25% of the static Rust binary comes from jemalloc, which is strange since musl doesn't seem to use jemalloc?
- dbaupp 10y agoRust chooses to call jemalloc for allocations by default[0], as it is generally faster than the system allocators, especially as we can go beyond the plain malloc/free interface. This choice is independent of the libc used, which Rust mainly uses for syscalls. [0]: http://doc.rust-lang.org/book/custom-allocators.html http://doc.rust-lang.org/book/custom-allocators.html