Skip to content

[codex] reduce release artifact size with release profile tuning#310

Merged
everettjf merged 1 commit intomainfrom
codex/release-profile-size-reduction
Mar 30, 2026
Merged

[codex] reduce release artifact size with release profile tuning#310
everettjf merged 1 commit intomainfrom
codex/release-profile-size-reduction

Conversation

@everettjf
Copy link
Copy Markdown
Contributor

This change reduces the default release artifact size by enabling standard Rust release-profile optimizations at the workspace root.

Before this change, the release binary was large even before any feature-level decomposition because the build was not stripping symbols and was not using a link-time optimization profile that favored a smaller final artifact. That meant users were paying a significant size cost regardless of which channels they actually configured at runtime.

The root cause is straightforward: the repository did not define an explicit [profile.release] section in Cargo.toml, so the build was using the default release profile without strip, without LTO tuning, and without constrained codegen unit settings. For a binary with a large dependency graph, that leaves a meaningful amount of size on the table.

This PR adds:

  • strip = true
  • lto = "thin"
  • codegen-units = 1

The practical outcome from a clean local cargo build --release on Apple Silicon was:

  • target/release/microclaw: 91M -> 57M
  • release tarball: 33M -> 24M

This PR intentionally does not change feature topology or split channel integrations yet. That follow-up work is tracked in #309, which covers making channel-specific integrations optional so that unused channels do not contribute to the default artifact size.

Validation for this PR was limited to a clean release rebuild and artifact measurement:

  • cargo clean && cargo build --release
  • repackaged target/release/microclaw into a release-style .tar.gz and compared sizes

@everettjf everettjf marked this pull request as ready for review March 30, 2026 05:09
@everettjf everettjf merged commit 00299b5 into main Mar 30, 2026
10 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.

1 participant