build: added more options to optimize release binary size#91
Open
goto-dev-null wants to merge 2 commits intoDj-Codeman:masterfrom
Open
build: added more options to optimize release binary size#91goto-dev-null wants to merge 2 commits intoDj-Codeman:masterfrom
goto-dev-null wants to merge 2 commits intoDj-Codeman:masterfrom
Conversation
goto-dev-null
commented
Mar 8, 2026
Author
There was a problem hiding this comment.
Unrelated typos I noticed but not really worth their own PR IMO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am still a bit of a newb to Rust myself so I am not fully confident in the best opt-level to use, or to leave it as default (
0). For doge, I'd be tempted to desire smaller binaries at the cost of performance; I'm not sure that its use case is one where you're going to see a noticeable change anyway...I tried to do some benchmarks with hyperfine and every command I ran (even with the opt-level "z" binary) ran in under 2.5ms.Meanwhile, the reduction in binary in size, depending on the target, can be pretty significant.
Here are the numbers based on the v0.2.9 release and this run on my fork:
opt-level 3
Out of my own curiosity, I wanted to see the difference between
opt-level = "z"andopt-level = 3. Here's the comparison for this run on my fork:So
opt-level = "z"seems to be have way more of an affect on apple and windows and less on linux, which I find fascinating.