Skip to content

cdylib artifact size boost #45613

Closed
Closed
@king6cong

Description

@king6cong

Hello, I find there is a huge boost in artifact size of cdylib library files in recent versions of rust. In our case, the lib doubles its size. I also find similar situations in other projects.

Here are the steps to reproduce (OS: 64bit Mac OS X 10.12.4 16E195):

git clone https://github.com/king6cong/sysinfo
cd sysinfo

on nightly-2017-06-30

rustup default nightly-2017-06-30
cargo clean
cargo build --features="c-interface"
ls -lht target/debug/libsysinfo.dylib
nm -g target/debug/libsysinfo.dylib|less

latest nightly (rustc 1.23.0-nightly (269cf50 2017-10-28))

rustup default nightly
cargo clean
cargo build --features="c-interface"
ls -lht target/debug/libsysinfo.dylib
nm -g target/debug/libsysinfo.dylib|less

Comparing the output:

# nightly-2017-06-30
751K Oct 29 17:59 target/debug/libsysinfo.dylib
# latest nightly
2.2M Oct 29 17:52 target/debug/libsysinfo.dylib

and there are many rust specific symbols in the latest nightly generated lib.

Library size matters, especially on mobile devices such as iOS and Android, definitely eager to figure out the reason :)

Metadata

Metadata

Labels

P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions