Hacker News new | past | comments | ask | show | jobs | submit login

Building in release:

  cargo build --release
  du -sh ./target/release/lstr -> 4.4M
Building with other release options brings it down to 2.3M:

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





I did some benchmarks on one of our CLI and found that `opt-level = "z"` reduced the size from 2.68M to 2.28M, and shaved 10% on the build time, worth a try.

I'll try with `panic = "abort"` for our next release, thanks for the reminder.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: