Skip to content

Reduce Cargo build artifact size - #228

Merged
terasakisatoshi merged 2 commits into
mainfrom
perf/cargo-artifact-reduction
Aug 9, 2026
Merged

Reduce Cargo build artifact size#228
terasakisatoshi merged 2 commits into
mainfrom
perf/cargo-artifact-reduction

Conversation

@terasakisatoshi

Copy link
Copy Markdown
Member

Summary

  • disable debuginfo in the workspace dev and test profiles while retaining Cargo's default debug assertions and overflow checks
  • add a stripped, non-incremental ci profile and use it for hosted tests and facade doctests
  • report Cargo artifact and filesystem usage in CI, and document the measurements and rejected integration-test consolidation experiment

Motivation and impact

The workspace produces many test executables containing generic numerical kernels, so duplicated debuginfo accounts for a large share of target usage.

On a fresh Apple Silicon target directory, debug = 0 reduced test artifacts from 1,717,360 KiB to 824,372 KiB (52.0%) and development artifacts from 1,082,416 KiB to 497,244 KiB (54.1%). The CI profile reduced test artifacts further to 703,520 KiB, approximately 59.0% below Cargo's default test profile.

Coverage retains its instrumentation-owned profile. An integration-test consolidation experiment was rejected because its additional 3.5% reduction did not justify weakened process isolation and less convenient focused test commands.

Validation

  • cargo fmt --all -- --check
  • cargo test --workspace
  • fresh-target build measurements recorded in docs/2026-08-09-cargo-artifact-reduction.md

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Repository rules review

Repository rules review (2570a4e391d4df75359ae043b620e7d79a3e64b0...fd96e76de4e47c76d0d769c010a9188d75f2b3c4)
Verdict: pass
LLM review: 1 chunk(s) (5496 chars) in 8.8s; 0 finding(s) returned, 0 kept, 0 dropped by diff-anchor filtering.
No findings.

@terasakisatoshi
terasakisatoshi marked this pull request as ready for review August 9, 2026 10:25
@terasakisatoshi
terasakisatoshi enabled auto-merge (squash) August 9, 2026 10:25
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