Skip to content

Shrink release binary with size-tuned profile#98

Open
juangaitanv wants to merge 2 commits into
mainfrom
feat/check-release-size
Open

Shrink release binary with size-tuned profile#98
juangaitanv wants to merge 2 commits into
mainfrom
feat/check-release-size

Conversation

@juangaitanv

@juangaitanv juangaitanv commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

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-heavy deps scan path ~4x slower, and the deflate repo-upload path in corgea scan is the same class of code. Dropped it; details in the review thread.

Profile Size deps scan (4,000-pkg lockfile, median of 15)
default release 9.35 MB 26 ms
strip + lto = "thin" (this PR) 7.78 MB 31 ms
+ opt-level = "s" 6.71 MB 86 ms
+ opt-level = "z" 5.84 MB 105 ms

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).
cursor[bot]
cursor Bot previously requested changes Jun 10, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one blocking production-readiness issue in the release profile change.

Open in Web View Automation 

Sent by Cursor Automation: pr-flow

Comment thread Cargo.toml Outdated
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.
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.

2 participants