Skip to content

Add panic=abort and opt-level=s to reduce binary size#646

Merged
bnusunny merged 2 commits intoaws:mainfrom
sparrc:sparrc
Mar 6, 2026
Merged

Add panic=abort and opt-level=s to reduce binary size#646
bnusunny merged 2 commits intoaws:mainfrom
sparrc:sparrc

Conversation

@sparrc
Copy link
Copy Markdown
Contributor

@sparrc sparrc commented Mar 4, 2026

Description of changes:

Add panic=abort and opt-level=s to cargo config to reduce binary size. Locally this reduces the size of the binary for me by 33% (~4mb to ~2.7mb).

Rust doc on options:

The downside obviously being not having stack traces, but I'd guess this would be a very rare occurrence, and the size savings might be worth the trade-off.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Taken together this reduces binary size by around 33%
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

📊 Benchmark Comparison

Benchmark Details
  • Baseline: main branch
  • Comparison: This PR
  • Threshold: 10% regression triggers warning

Copy link
Copy Markdown
Contributor

@bnusunny bnusunny left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the contribution.

@bnusunny bnusunny merged commit 1e734ce into aws:main Mar 6, 2026
4 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.

2 participants