antangelo / xdvdfs

Original Xbox DVD Filesystem library and management tool
https://xiso.antangelo.com/
MIT License
73 stars 8 forks source link

The Safety of Minimized Binary Size #61

Closed rizaumami closed 11 months ago

rizaumami commented 11 months ago

I compile this project using cargo build --release.

Default Cargo.toml:

[profile.release]
strip = "debuginfo"
lto = true

Generated 2,8 MB of compiled binary.

stat -c %s target/release/xdvdfs
2771112

Changing strip to true reduced binary size for a bit (don't care about breaking the xdvdfs-web)

stat -c %s target/release/xdvdfs
2357688

Following tips from here:

[profile.release]
strip = true
lto = true
opt-level = "z"
codegen-units = 1
panic = "abort"

Reduced the binary output to:

stat -c %s target/release/xdvdfs
1747384

Quite nice. 1 MB smaller. My question is; is it safe to use this config? Safe as in not going to break core functionality such as pack, unpack, etc.

antangelo commented 11 months ago

It shouldn't break anything in theory, but I don't test using any configuration besides what is in tree.