[codex] reduce release artifact size with release profile tuning#310
Merged
[codex] reduce release artifact size with release profile tuning#310
Conversation
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.
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 inCargo.toml, so the build was using the default release profile withoutstrip, 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 = truelto = "thin"codegen-units = 1The practical outcome from a clean local
cargo build --releaseon Apple Silicon was:target/release/microclaw:91M->57M33M->24MThis 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 --releasetarget/release/microclawinto a release-style.tar.gzand compared sizes