Binary size is significant increased from 1.46.0
to 1.51.0
#86610
Labels
C-bug
Category: This is a bug.
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
P-medium
Medium priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
In Brief
Our project changed the locked
rust-toolchain
from1.46.0
to1.51.0
.Then binary size (
x86_64-unknown-linux-gnu
,release
) is significant increased (49 MiB -> 53 MiB
,+8.2%
).Details
Size of
.strtab
section is significant increasedI used
cargo build --release
to build the same code withrust 1.46.0
andrust 1.51.0
.Then I analyzed the binary with
readelf -SW target/release/program
.I got the follow result:
Build with "rust 1.46.0" .
Build with "rust 1.51.0" .
The difference between the
.strtab
sectionsI don't have enough knowledge about compilation.
I just saw the
.strtab
was increased too much, so I used the follow command to read the.strtab
:readelf -p .strtab target/release/program
.Data in "rust 1.46.0" version looked like this:
Data in "rust 1.51.0" version looked like this:
Another test
I tried compiling
tokio-rs/mini-redis
with toolchain between 1.45.0 to 1.53.0.I got the follow table:
From the above table, we could got the follow conclusions:
1.46.0
to1.47.0
.1.51.0
.1.53.0
is still much bigger than1.46.0
.Related Issues
The text was updated successfully, but these errors were encountered: