Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upBinary size reduction after overriding default allocator to system allocator (nightly) #55910
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This should not happen. Hmm, can you strip symbols of both versions and see if then they become equal? |
This comment has been minimized.
This comment has been minimized.
|
@osa1 which system are you using? I cannot reproduce it on Arch Linux. |
This comment has been minimized.
This comment has been minimized.
Nope, 1195288 vs 1199384 bytes after stripping. Still not equal.
Ubuntu 18.04. |
This comment has been minimized.
This comment has been minimized.
|
I also run Ubuntu 18.04 and can reproduce the results before stripping, but not after:
The stripped binaries differ, but the output of Versions: $ rustc --version --verbose
rustc 1.32.0-nightly (6e9b84296 2018-11-10)
binary: rustc
commit-hash: 6e9b84296223126a0a59bde63a0f97011bb7b0f5
commit-date: 2018-11-10
host: x86_64-unknown-linux-gnu
release: 1.32.0-nightly
LLVM version: 8.0
$ strip --version
GNU strip (GNU Binutils for Ubuntu) 2.30
<snip> |
This comment has been minimized.
This comment has been minimized.
|
I think this is not really a bug nor an issue and would be in favor of closing it. The way the default is injected is every-so-subtly different than using If there's a large discrepancy then there may be a bug, otherwise this is probably just that libstd can inline better than |
osa1 commentedNov 13, 2018
Tried with rustc 1.32.0-nightly (65204a9 2018-11-12).
To reproduce:
cargo build --release && ls -lha target/release/tiny. You'll see a 2.4M binary.Originally reported on /r/rust thread.
The reason why I think this is a bug is because the default allocator should already be the system allocator, so overriding the allocator to system allocator should have no effect.