기준 프로필 사용
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
기준 프로필은 포함된 코드 경로의 해석과 JIT (Just-In-Time) 컴파일 단계를 피하여 최초 실행 후 코드 실행 속도를 약 30% 개선합니다. 앱 또는 라이브러리에 기준 프로필을 제공하면 Android 런타임 (ART)이 AOT (ahead-of-time) 컴파일을 통해 포함된 코드 경로를 최적화할 수 있으므로 모든 신규 앱 설치 및 모든 앱 업데이트에 향상된 성능을 제공합니다. 이 프로필 기반 최적화 (PGO)를 사용하면 앱이 시작을 최적화하고, 상호작용으로 인한 버벅거림을 줄이고, 최종 사용자를 위한 첫 실행부터 전반적인 런타임 성능을 개선할 수 있습니다.
Compose 성능 고려사항
Compose는 Android 플랫폼의 일부가 아닌 라이브러리로 배포됩니다.
이 접근 방식을 사용하면 Compose팀이 Compose를 자주 업데이트하고 다양한 Android 버전을 지원할 수 있습니다. 그러나 Compose를 라이브러리로 배포하면 비용이 발생합니다.
Android 플랫폼 코드는 이미 컴파일되어 기기에 설치되어 있습니다.
그러나 필요한 경우 앱이 실행되고 JIT를 해석할 때 라이브러리를 로드해야 합니다. 이로 인해 시작 시 및 라이브러리 기능을 처음 사용할 때 앱의 속도가 느려질 수 있습니다.
기준 프로필의 이점
기준 프로필을 정의하여 성능을 개선할 수 있습니다. 이러한 프로필은 중요한 사용자 여정에 필요한 클래스와 메서드를 정의하며 앱의 APK 또는 AAB와 함께 배포됩니다. 앱을 설치하는 동안 ART는 앱이 시작될 때 사용할 수 있도록 이 중요 코드 AOT를 컴파일합니다.
좋은 기준 프로필 정의가 항상 간단하지는 않으며, 따라서 Compose는 기본적으로 정의와 함께 제공됩니다. 이러한 이점을 보기 위해 별도의 작업을 하지 않아도 될 수도 있습니다. 그러나 Compose와 함께 제공되는 기준 프로필에는 Compose 라이브러리 내의 코드 최적화만 포함되어 있습니다.
Macrobenchmark
최적화를 최대한 활용하려면 Macrobenchmark를 사용하여 중요한 사용자 여정을 처리하는 앱용 기준 프로필을 생성합니다. 자체 프로필을 정의할 때는 프로필을 테스트하여 도움이 되는지 확인해야 합니다. 이를 위해서는 앱의 Macrobenchmark 테스트를 작성하고 기준 프로필을 작성하고 수정할 때 테스트 결과를 확인하는 것이 좋습니다.
Compose UI의 Macrobenchmark 테스트를 작성하는 방법에 관한 예는 Macrobenchmark Compose 샘플을 참고하세요.
추가 리소스
- 앱 성능 가이드: Android에서 성능을 개선하기 위한 권장사항, 라이브러리, 도구를 살펴봅니다.
- 성능 검사: 앱 성능을 검사합니다.
- 벤치마킹: 앱 성능을 벤치마킹합니다.
- 앱 시작: 앱 시작을 최적화합니다.
- 기준 프로필: 기준 프로필을 이해합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-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-07-27(UTC)"],[],[],null,["# Use a baseline profile\n\n[Baseline Profiles](/baseline-profiles) improve code execution speed by about 30% from the first\nlaunch by avoiding interpretation and just-in-time (JIT) compilation steps for\nincluded code paths. By shipping a Baseline Profile in an app or library, you\nenable Android Runtime (ART) to optimize included code paths through\nahead-of-time (AOT) compilation, providing performance enhancements for every\nnew app install and every app update. This profile-guided optimization (PGO)\nlets apps optimize startup, reduce interaction jank, and improve overall runtime\nperformance from the first launch for end users.\n\nCompose performance considerations\n----------------------------------\n\nCompose is distributed as a library instead of as part of the Android platform.\nThis approach lets the Compose team update Compose frequently and support a wide\nrange of Android versions. However, distributing Compose as a library imposes a\ncost.\n\nAndroid platform code is already compiled and installed on the device.\nLibraries, however, need to be loaded when the app launches and interpreted JIT\nwhen needed. This can slow the app on startup and when it uses a library feature\nfor the first time.\n\nBenefits of baseline profiles\n-----------------------------\n\nYou can improve performance by defining [Baseline Profiles](/topic/performance/baselineprofiles/overview). These profiles\ndefine classes and methods needed on critical user journeys and are distributed\nwith your app's APK or AAB. During app installation, ART compiles this critical\ncode AOT so that it's ready for use when the app launches.\n\nA good Baseline Profile definition is not always straightforward, and because\nof this, Compose ships with one by default. You might not have to do any work to\nsee this benefit. However, the Baseline Profile that ships with Compose only\ncontains optimizations for the code within the Compose library.\n\n### Macrobenchmark\n\nTo get the best optimization, [create a Baseline Profile](/topic/performance/baselineprofiles/create-baselineprofile)\nfor your app that uses [Macrobenchmark](/studio/profile/macrobenchmark-overview) to cover critical user journeys. When\nyou define your own profile, you must test the profile to verify that it's\nhelping. A good way to do that is to write [Macrobenchmark](/studio/profile/macrobenchmark-overview) tests for your\napp and check the test results as you write and revise your Baseline Profile.\n\nFor an example of how to write Macrobenchmark tests for your Compose UI, see the\n[Macrobenchmark Compose sample](https://github.com/android/performance-samples/tree/main/MacrobenchmarkSample).\n\nAdditional Resources\n--------------------\n\n- **[App performance guide](/topic/performance/overview)**: Discover best practices, libraries, and tools to improve performance on Android.\n- **[Inspect Performance](/topic/performance/inspecting-overview):** Inspect app performance.\n- **[Benchmarking](/topic/performance/benchmarking/benchmarking-overview):** Benchmark app performance.\n- **[App startup](/topic/performance/appstartup/analysis-optimization):** Optimize app startup.\n- **[Baseline profiles](/baseline-profiles):** Understand baseline profiles."]]