Skip to content

build: add release-lto profile for smaller binaries - #30

Merged
tharropoulos merged 1 commit into
mainfrom
lto
May 26, 2026
Merged

build: add release-lto profile for smaller binaries#30
tharropoulos merged 1 commit into
mainfrom
lto

Conversation

@tharropoulos

Copy link
Copy Markdown
Member

@tharropoulos
tharropoulos requested a review from ploMP4 May 23, 2026 11:00
@ploMP4

ploMP4 commented May 25, 2026

Copy link
Copy Markdown
Member

The optimized settings should be on the release profile directly instead of a separate release-lto, since that's what cargo install uses from crates.io and anyone installing from there won't get a proper release build. I also don't think we need to account for local development here since we can just use the debug build for that anyway.

@tharropoulos

Copy link
Copy Markdown
Member Author

I'm going off by what ripgreps already does.

@ploMP4

ploMP4 commented May 25, 2026

Copy link
Copy Markdown
Member

I'm going off by what ripgreps already does.

Ripgrep does it this way, but they also document it in their README on the cargo install path:

If you're a Rust programmer, ripgrep can be installed with cargo.
...
Note that the binary may be bigger than expected because it contains debug symbols. This is intentional. To remove debug symbols and therefore reduce the file size, run strip on the binary.

Since cargo install is one of our main install methods I'm not sure this is the right call for us. What's the argument for keeping it this way over just putting the optimized settings on the release profile directly?

@tharropoulos
tharropoulos merged commit d599589 into main May 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Link-Time Optimization (LTO) and codegen-units = 1 for Release builds (and possibly other options)

2 participants