refactor: 2차 대규모 View 리팩토링#311
Conversation
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (119)
📝 Walkthrough요약이 PR은 Pass 4 렌더링 성능 최적화를 마무리하는 2차 대규모 View 리팩토링으로, 다음과 같은 아키텍처 및 성능 개선사항을 포함합니다. 핵심 아키텍처 변경ProofPhotoReducer 상태 변경
Home Feature 리팩토링
Stats Feature 개선
의존성 및 테스팅 인프라새로운 PerfTestingSupport 공유 모듈
Feature별 UITest 추가
상태 변이 및 액션 흐름ProofPhoto
Home
테스트 커버리지
측정 결과 (Pass 4 완료)
문서화
주요 변경 파일: Projects/Feature/Home, ProofPhoto, Stats 및 공유 모듈 (PerfTestingSupport, DesignSystem), 테스트 타겟 전반, Tuist 설정 (모듈 추가, 의존성 재구성) TCA 수정사항: 라우팅 패턴 현대화 (IfLetStore → explicit scoping), 상태 계층 분리 (presentation layer), seed 기반 의존성 주입 Walkthrough공용 PerfTestingSupport 추가와 UITest 헬퍼 도입. 각 Feature 예제앱에 perfRoot/ready/state 마커와 하네스 연결. ProofPhoto 프리뷰 디코드 상태 저장 및 뷰 분기 수정. Home/Stats에 self-run 스크롤/마커 적용. Tuist 패키지 의존성 재구성과 여러 UITests 추가. 문서/스크립트 포함. ChangesPerf infra and feature wiring
Sequence Diagram(s)sequenceDiagram
rect rgba(66, 135, 245, 0.5)
participant Dev
participant Xcode as Xcode/UITests
participant App as Feature Example App
participant Infra as PerfTestingSupport
end
Dev->>Xcode: run UITest (launchForPerf)
Xcode->>App: inject -UITEST args + seed
App->>Infra: UITestMode.configureApplication()
App->>App: render root .perfRoot/.perfReadyMarker
Xcode->>App: waitForFeatureReady(slug)
App->>Infra: emit perfStateMarker/counters during flow
Xcode->>Xcode: measure metrics / record xctrace
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
|
@coderabbitai summary |
✅ Actions performedSummary regeneration triggered. |
jihun32
left a comment
There was a problem hiding this comment.
토큰 다 녹았겠네 ㅋㅋㅋㅋ 고생했어
근데 저번 PR도 그렇고 이번도 그렇고 View 내부에 퍼포먼스 측정을 위한 코드들이 많은데 이건 리팩토링 다 하면 지우는거야? 아니라면 따로 분리를 해야될 거 같음
| // Pass 4-S2 H-C2-a: avoid the shared `outsideBorder` modifier whose | ||
| // implementation re-overlays `self` inside the stroke (see | ||
| // `View+BorderInOutSide.swift`). During Home self-run scroll that | ||
| // duplicated subtree composition correlated with the | ||
| // "37 offscreen passes" hitch narrative and the 133 ms cold-cache | ||
| // hitch. The `.background { stroke }` form below is the local | ||
| // equivalent: stroke drawn at the view's bounds (half inside, half | ||
| // outside), the inside half hidden by the clipped content above, | ||
| // the outside half visible — same width / color / outside-edge | ||
| // alignment as `outsideBorder`, but without the second `self` | ||
| // composition. Shared `outsideBorder` modifier is intentionally | ||
| // unchanged; other call sites keep their existing behavior. | ||
| .background { | ||
| RoundedRectangle(cornerRadius: Constants.cornerRadius) | ||
| .stroke(Constants.borderColor, lineWidth: Constants.borderWidth * 2) | ||
| } |
There was a problem hiding this comment.
기존 outsideBorder보다 이게 더 좋은 거 같은데 아예 outsideBorder 로직을 이거로 변경해서 다 적용하는게 좋을듯
There was a problem hiding this comment.
@jihun32 오키오키
1차 2차 최종이 연계작업이라 리뷰들 전부다 보고 최종에 반영해서 올릴게~~!! 리뷰 고마웡
🔗 관련 이슈
📙 작업 내역
Summary
Pass 4 Rendering Optimization을 최종 종결합니다.
이번 Pass는 ProofPhoto image pipeline 최적화에서 시작했고, 이후 SwiftUI Template launch-mode / self-run 기반의 app-wide rendering audit까지 확장되었습니다.
최종 결과는 다음과 같습니다.
Key Changes
ProofPhoto
UIImage(data:)호출을 SwiftUI body 평가 경로에서 제거했습니다.previewImage를 reducer state에 저장해 image ingestion 시점에 한 번만 decode하도록 변경했습니다.imageData를 계속 사용하도록 보존했습니다.Home
GoalCardView의outsideBorder사용을 local.background { RoundedRectangle.stroke(...) }로 교체했습니다.outsideBordermodifier는 변경하지 않았습니다.Stats
Measurement Results
ProofPhoto P4-2
Home H-C2-a
Stats H-C5-a
Methodology Outcome
이번 Pass에서는 rendering 최적화 방법론도 함께 검증했습니다.
Pass 4-S2는 positive example입니다. SwiftUI signal, Time Profiler, Animation Hitches가 모두 개선되어 변경을 keep했습니다.
Pass 4-S3는 negative example입니다. SwiftUI signal은 움직였지만 TP/Hitches가 corroborate하지 않았고, 실제 Hitches가 악화되어 변경을 revert했습니다.
Validation
Follow-up
Pass 4는 종료되었습니다.
남은 rendering 후보는 Pass 5 handoff 문서로 이관했습니다.
docs/perf-infra/reports/_workspace/pass5-rendering-candidate-handoff.mdPass 5는 Pass 4를 ad-hoc으로 이어서 진행하지 않고, 위 handoff 문서를 기준으로 별도 계획과 승인 후 시작해야 합니다.