Shrink release binary with size-tuned profile#98
Open
juangaitanv wants to merge 2 commits into
Open
Conversation
strip + thin LTO + opt-level=z cuts the darwin-arm64 binary 9.35 MB -> 5.84 MB raw (-37%), 3.63 MB -> 2.64 MB zipped (-27%). Binary verified working; release build time unchanged (~2m).
Benchmarks (macOS arm64, 4000-package npm lockfile, 15 runs, median): profile size deps scan deps graph default release 9.80 MB 26 ms 65 ms strip + thin LTO 8.16 MB 31 ms 67 ms + opt-level "s" 7.04 MB 86 ms 76 ms + opt-level "z" 6.13 MB 105 ms 84 ms strip + thin LTO takes half the size win at no measurable runtime cost. opt-level=z bought 2 MB more but made the serde-heavy deps scan path ~4x slower, and would hit the deflate repo-upload path in `corgea scan` hardest. Addresses the PR #98 review comment.
leenk7991
approved these changes
Jun 11, 2026
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.


strip + thin LTO cuts the darwin-arm64 binary 9.35 MB -> 7.78 MB raw (-17%), 3.61 MB -> 3.25 MB zipped (-10%). Binary verified working.
Originally also set
opt-level = "z"(-37% raw), but benchmarks showed it makes the serde-heavydeps scanpath ~4x slower, and the deflate repo-upload path incorgea scanis the same class of code. Dropped it; details in the review thread.deps scan(4,000-pkg lockfile, median of 15)strip+lto = "thin"(this PR)opt-level = "s"opt-level = "z"