Wear OS의 Compose 성능
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Wear OS에서 성능은 앱의 필수 고려사항입니다. 많은 Wear OS 기기가 더 큰 휴대기기에 비해 CPU 및 GPU 리소스가 제한되어 있기 때문입니다.
여러 기법이 유사하므로 Jetpack Compose의 지식을 사용하여 Wear OS용 Compose로 성능을 개선하는 앱을 구성하고 개발하세요. 그러나 Wear OS에서 앱의 성능을 테스트하는 방법을 이해하는 것이 중요합니다.
성능 개념을 더 잘 이해하려면 YouTube에서 성능 권장사항 및 Wear OS용 뛰어난 전력 효율의 아름다운 앱 만들기를 참고하세요.
성능 개선 기법
앱 성능을 정확하게 이해하려면 출시 모드에서 앱을 실행해 보세요. 디버그 모드는 여러 문제를 발견하는 데 유용하지만 상당한 성능 비용이 발생하며 성능을 저하할 수 있는 다른 코드 문제를 발견하기가 어려워질 수 있습니다. 또한 디버그 모드는 기준 프로필을 사용하지 않으므로 성능이 더 저하될 수 있습니다. R8 컴파일러도 사용하여 앱을 축소하고 최적화해야 합니다. 사용하지 않는 리소스를 삭제하는 방법에 관한 자세한 내용은 리소스 축소를 참고하세요.
실시간 편집, 컴포저블 미리보기, Wear OS 에뮬레이터를 비롯한 Android 스튜디오 도구를 숙지합니다. 이렇게 하면 시계에서 앱을 디버깅하는 데 걸리는 시간이 줄어들어 생산성을 개선할 수 있습니다. Android 스튜디오는 시계 AVD와 함께 제공됩니다. 앱이 대부분 예상한 대로 작동할 때까지 Compose 미리보기와 실시간 편집으로 테스트한 후 기기에서 앱의 성능이 정확하게 반영되는지 테스트하세요.
JankStats 라이브러리를 사용하여 애플리케이션의 성능 문제를 추적하고 분석합니다. 예시는 GitHub의 JankStats 샘플을 참고하세요.
기준 프로필 사용
중요한 사용자 여정에 필요한 클래스와 메서드를 정의하여 앱의 성능을 개선하는 데 기준 프로필을 사용하세요. 이 주제에 관한 자세한 내용은 기준 프로필을 참고하세요. 각 Wear OS용 Compose 라이브러리는 자체 프로필 규칙과 함께 제공됩니다. 앱이 라이브러리에 종속되면 라이브러리 프로필 규칙이 자동으로 앱의 APK와 병합되어 배포되고 기기에서 미리 컴파일됩니다. 그러면 시작 시간이 단축되고 버벅거리는 프레임이 줄며 성능이 개선됩니다.
자체 앱 프로필을 정의하려는 경우 Macrobenchmark 테스트를 작성하여 성능이 개선되는지 확인하세요.
예시는 GitHub의 성능 샘플을 참고하세요.
기준 프로필 명령어
기준 프로필 작업에 사용할 수 있는 유용한 명령어가 있습니다. 먼저 다음을 실행하여 프로필의 상태를 확인합니다.
adb shell dumpsys package dexopt | grep -A 1 $PACKAGE_NAME
상태가 status=speed-profile
이 아니면 앱을 최적화하기 위한 규칙이 아직
적용되지 않은 것입니다.
Wear OS용 Compose 프로필 규칙은 기기가 충전되고 유휴 상태일 때 실행되는 백그라운드 작업을 사용하여 적용됩니다. 앱이 실행되고 프로필 설치 프로그램이 백그라운드에서 프로필을 부트스트랩할 수 있도록 충분한 시간이 경과한 후 다음 명령어를 실행하여 이를 수동으로 트리거할 수 있습니다. 일반적으로 40초 정도 걸립니다.
adb shell cmd package bg-dexopt-job
그런 다음 이전 명령어를 다시 실행하여 상태가 이제 speed-profile
인지 확인합니다.
설치 시 최적화가 실행되는 상황은 기준 프로필 사이드로드를 참고하세요.
추천 서비스
- 참고: JavaScript가 사용 중지되어 있으면 링크 텍스트가 표시됩니다.
- 앱 성능 측정 개요
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-27(UTC)"],[],[],null,["Performance on Wear OS is an essential app consideration, as many Wear OS\ndevices have limited CPU and GPU resources compared to larger mobile devices.\nYou can use your knowledge from [Jetpack Compose](/jetpack/compose/performance) to configure and develop\nyour app to improve performance with Compose for Wear OS, as many of the\ntechniques are similar. However, it's important to understand how to test your\napp's performance on Wear OS.\n\nTo better understand performance concepts, watch\n[Performance best practices](https://www.youtube.com/watch?v=EOQB8PTLkpY) and\n[Create beautiful, power efficient apps for Wear OS](https://www.youtube.com/watch?v=jpUVamtoKOs&t=1052s) on YouTube.\n\nTechniques to improve performance\n\nTo accurately understand your app's performance, try running your app in\n[release mode](/studio/run#changing-variant). Debug mode is useful for spotting lots of problems, but it\nimposes a significant performance cost, and can make it hard to spot other code\nissues that might be hurting performance. In addition, debug mode does not use\nbaseline profiles, which can further deteriorate performance. You should also\nuse the [R8 compiler](/studio/build/shrink-code) to shrink and optimize your app. For more information\non removing unused resources, see [Shrink your resources](/studio/build/shrink-code#shrink-resources).\n\nFamiliarize yourself with [Android Studio tools](/jetpack/compose/tooling)\nincluding Live Edit, Composable Preview, and Wear OS emulator. This can reduce\nthe amount of time spent debugging your app on a watch, which can improve your\nproductivity. Android Studio ships with a watch AVD. Test with Compose Previews\nand Live Edit until your app is largely working as expected, then test on a\ndevice for an accurate reflection of your app's performance.\n\nUse the [JankStats library](/topic/performance/jankstats) to track and analyze\nperformance problems in your applications. For an example, see the\n[JankStats sample](https://github.com/android/performance-samples/tree/main/JankStatsSample) on GitHub.\n\nUse a baseline profile\n\n[Use a baseline profile](/jetpack/compose/performance#use-baseline) to improve your app's performance by defining\nclasses and methods needed on critical user journeys. For an in depth guide on\nthis topic, see [Baseline profiles](/topic/performance/baselineprofiles). Each\nCompose for Wear OS library ships with its own profile rules. When your app\ndepends on a library, the library profile rules are automatically merged and\ndistributed with your app's APK and are compiled ahead of time on device. This\ncan reduce start-up times, cut down janky frames, and otherwise improve\nperformance.\n\nIf you choose to define your own profile for an app, verify that it does\nimprove performance by writing Macrobenchmark tests.\nFor an example, see\n[Performance samples](https://github.com/android/performance-samples/blob/main/MacrobenchmarkSample/baseBenchmarks/src/main/java/com/example/benchmark/macro/base/startup/StartupBenchmark.kt) on GitHub.\n\nBaseline profile commands\n\nThere are some useful commands you can use to help working with baseline\nprofiles. First, determine the status of your profile by running the\nfollowing: \n\n adb shell dumpsys package dexopt | grep -A 1 $PACKAGE_NAME\n\nIf the status is not `status=speed-profile`, the rules have not yet been applied\nto optimize the app.\n\nCompose for Wear OS profile rules are applied using a background job which runs\nwhen the device is charged and idle. You can manually trigger this by running\nthe following command after the app has been launched and enough time has passed\nto allow the profile-installer to bootstrap the profile in the background. This\ntypically takes around 40 seconds. \n\n adb shell cmd package bg-dexopt-job\n\nYou can then re-run the previous command to check that the status is now\n`speed-profile`.\n\nFor situations when the optimisation is performed at install, see\n[Sideload the baseline profile](/topic/performance/baselineprofiles#measuring-baseline).\n\nRecommended for you\n\n- Note: link text is displayed when JavaScript is off\n- [Overview of measuring app performance](/topic/performance/measuring-performance)"]]