perf: release 빌드에 LTO + codegen-units=1 + strip 활성화#818
Closed
oksure wants to merge 2 commits into
Closed
Conversation
Reduces release binary size (~23% reduction) and improves runtime performance through more aggressive compiler optimizations. Only affects release profile — development builds remain fast. Closes edwardkim#790
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Rust build configuration to optimize release artifacts by enabling more aggressive compiler/linker optimizations and stripping.
Changes:
- Enable Fat LTO for cross-crate optimization in release builds.
- Force
codegen-units = 1to maximize global optimization opportunities. - Enable
stripin release builds to reduce final artifact size.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [profile.release] | ||
| lto = true | ||
| codegen-units = 1 | ||
| strip = true |
Copilot 리뷰 반영: strip=true는 심볼까지 제거하여 panic backtrace가 무용해짐. strip="debuginfo"로 변경하여 DWARF만 제거하고 심볼은 보존.
Contributor
Author
|
Copilot 리뷰 반영 (cdde2bd):
|
edwardkim
added a commit
that referenced
this pull request
May 11, 2026
…p 활성화 @oksure — Issue #790 (외부 제안): Cargo.toml [profile.release] 영역 LTO + codegen-units=1 + strip 활성화 영역 바이너리 크기 축소 + 런타임 성능 개선. 본질 (2 commits, Cargo.toml +5/-0): - lto = true (Fat LTO, 크로스 크레이트 인라이닝 최적화) - codegen-units = 1 (단일 코드젠 유닛, 전역 최적화 극대화) - strip = "debuginfo" (디버그 정보 제거, panic backtrace symbol table 보존) - 리뷰 반영 commit (9ccb0c3): strip = true → strip = "debuginfo" 정정 본 환경 충돌 수동 해결 (Cargo.toml): - devel 측 — PR #599 example pr599_png_gateway (native-skia required) - PR 측 — [profile.release] 영역 5 라인 추가 - 양측 모두 보존 (PR #599 example + [profile.release] 정합) 본 환경 정량 측정: | 항목 | before | after | 차이 | |------|--------|-------|------| | rhwp CLI 크기 | 14 MB | 10 MB | -4 MB (-28%) | | WASM 크기 | 4.6 MB | 4.3 MB | -0.3 MB (-6.5%) | | cargo build --release (clean) | ~58s | 2m 53s | +1m 55s (~3배) | | WASM 빌드 (Docker) | ~1m 30s | 2m 23s | +53s (+59%) | | cargo test | ALL GREEN | ALL GREEN | 회귀 0 | | cargo clippy -D warnings | 통과 | 통과 | 회귀 0 | | sweep 7 fixture / 170 페이지 | baseline | 170 same / 0 diff | byte-identical | → 빌드 시간 ~3배 증가 영역 release 빌드 한정 (개발 빌드 영향 부재). sweep byte-identical 영역 SVG 출력 무영향 입증.
Owner
|
@oksure 머지 완료 (commit 본 환경 정량 측정 결과 — 매우 좋은 이득:
자기 검증 — cargo test ALL GREEN + cargo clippy -D warnings 통과 + 광범위 sweep 7 fixture / 170 페이지 / 회귀 0 (byte-identical) 입증. 빌드 시간 증가 영역 release 빌드 한정 영역 개발 빌드 영향 부재.
본 환경 충돌 수동 해결 (Cargo.toml): devel 측 PR #599 example pr599_png_gateway + PR 측 [profile.release] 양측 보존. 수고하셨습니다. |
edwardkim
added a commit
that referenced
this pull request
May 11, 2026
- mydocs/pr/archives/pr_818_review.md (LTO + CU1 + strip 분석) - mydocs/pr/archives/pr_818_report.md (옵션 A 처리 결과 + 정량 측정) - mydocs/orders/20260512.md PR #818 행 추가 본 환경 정량 측정: - rhwp CLI: 14 MB → 10 MB (-28%) - WASM: 4.6 MB → 4.3 MB (-6.5%) - cargo build --release: ~58s → 2m 53s (~3배) - WASM 빌드 (Docker): ~1m 30s → 2m 23s (+59%) - sweep 7 fixture / 170 페이지 / byte-identical 입증 - cargo test/clippy ALL GREEN
edwardkim
added a commit
that referenced
this pull request
May 17, 2026
버전 0.7.11 → 0.7.12 (Cargo.toml + rhwp-vscode/npm-editor/rhwp-studio package.json) CHANGELOG 갱신 (CHANGELOG.md / CHANGELOG_EN.md / rhwp-vscode/CHANGELOG.md) WASM 재빌드 산출물 동기화 (rhwp-studio/public/rhwp.js) @jangster77 7-PR 시리즈 (#956~#968) + Issue #952 5-결함 완결 + WMF #966 + HWP3 #968 + LTO #818 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Merged
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.
요약
[profile.release]에 LTO(Fat), codegen-units=1, strip 옵션을 추가하여 릴리즈 바이너리 크기를 줄이고 런타임 성능을 개선합니다.변경 사항
lto = true— Fat LTO로 크로스 크레이트 인라이닝 최적화codegen-units = 1— 단일 코드젠 유닛으로 전역 최적화 극대화strip = true— 심볼 테이블 제거로 바이너리 크기 축소벤치마크 (Linux x86_64, Rust 1.87)
개발 빌드(
cargo build)에는 영향 없음 — release 프로파일에만 적용됩니다.Closes #790
감사합니다.