Skip to content

Conversation

@DongChyeon
Copy link
Member

@DongChyeon DongChyeon commented Nov 23, 2025

Related issue 🛠

closed #275

어떤 변경사항이 있었나요?

  • 🐞 BugFix Something isn't working
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (Junit, etc.)

CheckPoint ✅

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • PR 컨벤션에 맞게 작성했습니다. (필수)
  • merge할 브랜치의 위치를 확인해 주세요(main❌/develop⭕) (필수)
  • Approve된 PR은 assigner가 머지하고, 수정 요청이 온 경우 수정 후 다시 push를 합니다. (필수)
  • BugFix의 경우, 버그의 원인을 파악하였습니다. (선택)

Work Description ✏️

  • 네비게이션 로직 없이 화면 단위, UI 단위 성능 벤치마크를 용이하게 하기 위해 BenchmarkHostActivity 구현
  • Intent를 통해 벤치마크할 요소를 결정

OrbitPicker (타임피커) 개선 전(aed700e) 과 개선 후 벤치마크 결과

  • 개선 전
    OrbitPickerBenchmarks_orbitPickerScrollCompilationNone
    frameCount           min   5.0,   median   6.0,   max   6.0
    frameDurationCpuMs   P50   18.3,   P90   58.2,   P95   59.5,   P99   63.1
    frameOverrunMs       P50   26.9,   P90  203.5,   P95  219.1,   P99  221.2
    Traces: Iteration 0 1 2 3 4 5 6 7 8 9
    
    OrbitPickerBenchmarks_orbitPickerScrollCompilationBaselineProfile
    frameCount           min   6.0,   median   6.0,   max   6.0
    frameDurationCpuMs   P50    9.8,   P90   48.6,   P95   52.3,   P99   60.5
    frameOverrunMs       P50    6.1,   P90  185.0,   P95  220.5,   P99  289.6
    Traces: Iteration 0 1 2 3 4 5 6 7 8 9
    
  • 개선 후
    OrbitPickerBenchmarks_orbitPickerScrollCompilationNone
    frameCount           min   5.0,   median   6.0,   max   6.0
    frameDurationCpuMs   P50   14.6,   P90   64.1,   P95   76.8,   P99   83.0
    frameOverrunMs       P50    8.8,   P90  206.7,   P95  224.5,   P99  256.9
    Traces: Iteration 0 1 2 3 4 5 6 7 8 9
    
    OrbitPickerBenchmarks_orbitPickerScrollCompilationBaselineProfile
    frameCount           min   6.0,   median   6.0,   max   6.0
    frameDurationCpuMs   P50   10.2,   P90   46.0,   P95   49.2,   P99   92.1
    frameOverrunMs       P50    0.4,   P90  191.7,   P95  205.1,   P99  223.7
    Traces: Iteration 0 1 2 3 4 5 6 7 8 9
    

P50 성능 비교표

Benchmark Type Metric Before After Change
BaselineProfile (CompilationBaseline) frameDurationCpuMs 9.8 ms 10.2 ms +0.4 ms (≈ 동일)
BaselineProfile (CompilationBaseline) frameOverrunMs 6.1 ms 0.4 ms -5.7 ms (개선)
CompilationNone frameDurationCpuMs 18.3 ms 14.6 ms -3.7 ms (개선)
CompilationNone frameOverrunMs 26.9 ms 8.8 ms -18.1 ms (대폭 개선)

Uncompleted Tasks 😅

N/A

To Reviewers 📢

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 성능 측정을 위한 벤치마킹 인프라가 추가되었습니다.
    • 벤치마크 테스트 환경 및 테스트 화면이 구현되었습니다.
    • OrbitPicker 컴포넌트에 대한 벤치마크 테스트 케이스가 추가되었습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 23, 2025

Walkthrough

벤치마크 전용 호스트 액티비티를 생성하고 관련 인프라를 구성합니다. BenchmarkHostActivity는 인텐트 엑스트라를 통해 특정 벤치마크 화면을 동적으로 라우팅하며, OrbitPicker 컴포넌트에 대한 벤치마크 화면과 macrobenchmark 테스트가 추가됩니다.

Changes

Cohort / File(s) Change Summary
빌드 구성
app/build.gradle.kts
benchmarkRelease 소스 세트에 전용 AndroidManifest.xml을 연결하기 위해 androidComponents.finalizeDsl 구성 추가
벤치마크 매니페스트
app/src/benchmarkRelease/AndroidManifest.xml
BenchmarkHostActivity 액티비티 선언이 포함된 새로운 매니페스트 파일 (exported=true, 테마 및 라벨 설정)
벤치마크 호스트 인프라
app/src/benchmarkRelease/java/com/yapp/orbit/benchmark/BenchmarkHostActivity.kt
인텐트 엑스트라를 통해 벤치마크 화면을 동적으로 라우팅하는 ComponentActivity 구현, BenchmarkScreenContainer 및 BenchmarkScreenMissing 컴포저블 추가
OrbitPicker 벤치마크 화면
app/src/benchmarkRelease/java/com/yapp/orbit/benchmark/OrbitPickerBenchmarkScreen.kt
OrbitPicker 컴포넌트 렌더링 상태 관리 및 ReportDrawnWhen을 통한 성능 측정 신호 전달을 포함한 벤치마크 화면 구현
벤치마크 테스트
baselineprofile/src/main/java/com/dongchyeon/baselineprofile/OrbitPickerBenchmarks.kt
컴파일 모드별 (None/BaselineProfile) OrbitPicker 스크롤 성능을 측정하는 macrobenchmark 테스트 클래스 및 테스트 메서드 추가

Sequence Diagram(s)

sequenceDiagram
    participant Test as MacrobenchmarkRule
    participant Activity as BenchmarkHostActivity
    participant Router as BenchmarkScreenContainer
    participant Screen as OrbitPickerBenchmarkScreen
    
    Test->>Activity: startActivity (EXTRA_BENCHMARK_SCREEN)
    Activity->>Activity: readExtra (benchmark_screen_key)
    Activity->>Router: BenchmarkScreenContainer(screenKey)
    
    alt screenKey == "orbit_picker"
        Router->>Screen: OrbitPickerBenchmarkScreen()
        Screen->>Screen: Initialize state (selectedTime, drawn)
        Screen->>Screen: ReportDrawnWhen(drawn)
        Screen->>Screen: Render OrbitPicker + LaunchedEffect
    else screenKey unknown
        Router->>Router: BenchmarkScreenMissing(screenKey)
        Router->>Router: Display error state
    end
    
    Test->>Test: Measure frame timing
    Test->>Test: Perform swipe gesture
    Test->>Test: Wait for idle
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10분

  • 파일 변경이 대부분 새로운 파일 추가이며, 기존 코드베이스 영향이 제한적
  • 벤치마크 인프라는 명확한 패턴을 따르고 비즈니스 로직 복잡도가 낮음
  • 다음 항목들에 주의:
    • app/build.gradle.ktsandroidComponents.finalizeDsl 구성이 올바르게 manifest를 연결하는지 확인
    • BenchmarkHostActivity의 라우팅 로직이 모든 벤치마크 화면을 정상적으로 처리하는지 검증
    • OrbitPickerBenchmarks.kt의 swipe 제스처 계산과 bounds 처리가 정확한지 확인

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 주요 변경사항인 BenchmarkHostActivity 생성을 명확하게 설명하며, 모든 파일 변경사항이 이 목표와 관련되어 있습니다.
Linked Issues check ✅ Passed BenchmarkHostActivity 생성 (#275 체크리스트 항목 1 충족), Compose 래퍼를 통한 UI 주입 (#275 체크리스트 항목 2 충족), Intent 기반 화면 선택, OrbitPickerBenchmarkScreen 추가 등 모든 요구사항이 구현되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 벤치마크 호스트 액티비티 구현 및 OrbitPicker 벤치마크 구성이라는 명확한 목표에 맞춰져 있으며, 범위를 벗어난 변경사항이 없습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#275-benchmark-host-activity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
app/src/benchmarkRelease/java/com/yapp/orbit/benchmark/BenchmarkHostActivity.kt (1)

20-61: 벤치마크 호스트 라우팅 구조가 단순하고 확장 가능하게 잘 잡혀 있습니다

EXTRA_BENCHMARK_SCREEN 키로 단일 Activity에서 벤치마크 스크린을 스위치하는 구조와, 미등록 키에 대해 BenchmarkScreenMissing을 보여주는 처리가 디버깅에도 도움이 될 것 같습니다. 스크린 키가 더 늘어날 경우를 대비해 sealed class/enum 등으로 키를 묶는 것도 고려해볼 수 있지만, 현재 규모에서는 지금처럼 단순한 when 분기가 가독성과 유지 보수 측면에서 충분해 보입니다.

baselineprofile/src/main/java/com/dongchyeon/baselineprofile/OrbitPickerBenchmarks.kt (1)

25-75: Baseline Profile 모드 고정 여부를 한 번 고민해 볼 만합니다

현재는 CompilationMode.Partial()을 그대로 사용하고 있어서, 베이스라인 프로파일이 누락된 상태에서도 테스트가 그대로 통과할 수 있습니다. 베이스라인 프로파일이 실제로 적용되지 않은 경우를 확실히 잡아내고 싶다면 CompilationMode.Partial(baselineProfileMode = BaselineProfileMode.Require) 형태로 실패를 강제하는 옵션도 고려해 보셔도 좋겠습니다; 그런 요구가 없다면 지금 구현만으로도 벤치마크 자체는 충분히 목적에 부합해 보입니다.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e33681a and 6ee1ab8.

📒 Files selected for processing (5)
  • app/build.gradle.kts (1 hunks)
  • app/src/benchmarkRelease/AndroidManifest.xml (1 hunks)
  • app/src/benchmarkRelease/java/com/yapp/orbit/benchmark/BenchmarkHostActivity.kt (1 hunks)
  • app/src/benchmarkRelease/java/com/yapp/orbit/benchmark/OrbitPickerBenchmarkScreen.kt (1 hunks)
  • baselineprofile/src/main/java/com/dongchyeon/baselineprofile/OrbitPickerBenchmarks.kt (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-16T14:32:09.264Z
Learnt from: DongChyeon
Repo: YAPP-Github/Orbit-Android PR: 233
File: domain/src/main/java/com/yapp/domain/usecase/AlarmUseCase.kt:38-61
Timestamp: 2025-07-16T14:32:09.264Z
Learning: In the Orbit-Android project, the team prefers to focus unit testing on core business logic rather than UseCase wrapper methods to avoid unnecessary dependency mocking costs. They consider it sufficient to test the main formatting logic (like formatTimeDifference) rather than testing thin wrapper methods in UseCases.

Applied to files:

  • baselineprofile/src/main/java/com/dongchyeon/baselineprofile/OrbitPickerBenchmarks.kt
  • app/src/benchmarkRelease/java/com/yapp/orbit/benchmark/OrbitPickerBenchmarkScreen.kt
🧬 Code graph analysis (2)
app/src/benchmarkRelease/java/com/yapp/orbit/benchmark/OrbitPickerBenchmarkScreen.kt (2)
core/ui/src/main/java/com/yapp/ui/component/timepicker/OrbitPicker.kt (1)
  • OrbitPicker (39-167)
core/designsystem/src/main/java/com/yapp/designsystem/theme/Theme.kt (1)
  • OrbitTheme (12-28)
app/src/benchmarkRelease/java/com/yapp/orbit/benchmark/BenchmarkHostActivity.kt (2)
core/designsystem/src/main/java/com/yapp/designsystem/theme/Theme.kt (1)
  • OrbitTheme (12-28)
app/src/benchmarkRelease/java/com/yapp/orbit/benchmark/OrbitPickerBenchmarkScreen.kt (1)
  • OrbitPickerBenchmarkScreen (28-60)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (2)
app/src/benchmarkRelease/AndroidManifest.xml (1)

4-10: Benchmark 전용 Activity export 설정은 적절해 보입니다

BenchmarkHostActivity를 별도 benchmarkRelease 매니페스트에서 android:exported="true"로만 노출한 점이 Macrobenchmark 용도로는 적절해 보입니다. 다만 이 variant가 실제 스토어 배포용 빌드 구성에 포함되지 않는지만(내부/벤치마크 전용인지) 한 번만 빌드 설정을 확인해 두시면 안전할 것 같습니다.

app/src/benchmarkRelease/java/com/yapp/orbit/benchmark/OrbitPickerBenchmarkScreen.kt (1)

28-60: OrbitPicker 벤치마크 스크린 구성이 테스트 시나리오에 잘 맞습니다

선택된 시간 state, ReportDrawnWhen 기반 프레임 완료 신호, 그리고 contentDescription = ORBIT_PICKER_BENCHMARK_ROOT 설정이 baselineprofile 쪽 상수("orbit_picker_root")와 정확히 매칭되어 있어서, 매크로벤치마크에서 대상 뷰 탐색과 스크롤 제스처 측정이 안정적으로 동작할 것으로 보입니다.

@DongChyeon DongChyeon merged commit c05e27b into develop Nov 23, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Benchmark Host Activity 생성

2 participants