Skip to content

Commit

Permalink
feat: reduce executable size
Browse files Browse the repository at this point in the history
# Slim executables

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

## References
- https://doc.rust-lang.org/stable/rustc/codegen-options/
- https://doc.rust-lang.org/rustc/profile-guided-optimization.html
- https://github.com/johnthagen/min-sized-rust
  • Loading branch information
YOU54F committed Apr 30, 2024
1 parent 98e16e8 commit eed40d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
push:
branches:
- feat/musl_linux_win_aarch64
- feat/slim_bins

concurrency:
group: ci-${{ github.ref }}
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,8 @@ trim-margin = "0.1.0"
built = { version = "0.7.2", features = [ "git2" ] }
os_info = "3.8.2"

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

0 comments on commit eed40d6

Please sign in to comment.