Jetpack Compose 성능
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Jetpack Compose는 처음부터 뛰어난 성능을 제공합니다. 일반적인 실수를 피하고 Compose 애플리케이션의 성능을 최적화할 수 있도록 권장사항에 따라 앱을 구성합니다.
주요 개념
다음은 Compose의 성능에 관한 몇 가지 주요 개념입니다.
- 단계: 컴포지션, 레이아웃, 그리기 단계를 이해하는 것은 Compose가 UI를 업데이트하는 방식을 최적화하는 데 중요합니다.
- 기준 프로필: 이 프로필은 필수 코드를 사전 컴파일하여 앱을 더 빠르게 실행하고 더 원활한 상호작용을 지원합니다.
- 안정성: 앱의 안정성을 높여 불필요한 재구성을 더 효율적으로 건너뛰고 성능을 개선합니다.
적절한 앱 구성
앱이 제대로 작동하지 않으면 구성 문제가 있을 수 있습니다. 첫 단계로 다음 구성 옵션을 확인하는 것이 좋습니다.
- R8을 사용하여 출시 모드로 빌드: 출시 모드에서 앱을 실행해 봅니다. 디버그 모드는 많은 문제를 발견하는 데 유용하지만 성능 비용이 발생하고 다른 문제를 발견하기가 어려워질 수 있습니다. 또한 성능이 우수하고 효율적인 출시 빌드를 보장하려면 R8 컴파일러로 최적화 및 축소를 사용 설정해야 합니다.
- 기준 프로필 사용: 기준 프로필은 중요한 사용자 여정용 코드를 사전 컴파일하여 성능을 개선합니다. Compose에는 기본 프로필이 포함되어 있지만 이상적으로는 앱별 프로필도 만드는 것이 좋습니다. 일반 Android 성능 문서에서 기준 프로필에 관해 자세히 알아보기
Compose 앱의 성능을 측정하고 분석하는 데 도움이 되는 도구 모음을 숙지합니다.
권장사항
Compose를 사용하여 앱을 개발할 때는 다음 권장사항에 유의하세요.
자세한 내용은 권장사항 가이드를 참고하세요.
조회수
Compose 대신 뷰를 사용하는 경우 전용 레이아웃 성능 개선 가이드를 참고하세요.
추가 리소스
- 앱 성능 가이드: Android에서 성능을 개선하기 위한 권장사항, 라이브러리, 도구를 살펴봅니다.
- 성능 검사: 앱 성능을 검사합니다.
- 벤치마킹: 앱 성능을 벤치마킹합니다.
- 앱 시작: 앱 시작을 최적화합니다.
- 기준 프로필: 기준 프로필을 이해합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-26(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-26(UTC)"],[],[],null,["# Jetpack Compose Performance\n\nJetpack Compose delivers excellent performance out of the box. Configure your\napp using best practices to avoid common pitfalls and optimize your Compose\napplication's performance.\n\nKey concepts\n------------\n\nThese are some of the key concepts for performance in Compose:\n\n- **[Phases](/develop/ui/compose/performance/phases):** Understanding the composition, layout, and drawing phases is crucial for optimizing how Compose updates your UI.\n- **[Baseline Profiles](/develop/ui/compose/performance/baseline-profiles):** These profiles precompile essential code, leading to faster app launches and smoother interactions.\n- **[Stability](/develop/ui/compose/performance/stability):** Increase the stability of your app to more efficiently skip unnecessary recompositions, improving performance.\n\nProperly configure your app\n---------------------------\n\nIf your app is performing poorly, there might be a configuration problem. A good\nfirst step is to check the following configuration options:\n\n- **Build in Release Mode with R8:** Try running your app in [release\n mode](/studio/run#changing-variant). Debug mode is useful for spotting many problems, but it imposes a performance cost and can make it hard to spot other issues. You should also [enable optimizing and shrinking](/build/shrink-code#enable) with the R8 compiler to ensure a performant and efficient release build.\n- **Use Baseline Profiles:** Baseline Profiles improve performance by precompiling code for critical user journeys. Compose includes a default profile, but ideally, you should create an app-specific one as well. [Learn\n more about Baseline Profiles in the general Android performance docs](/topic/performance/baselineprofiles/overview)\n\nTools\n-----\n\nFamiliarize yourself with the suite of [tools](/develop/ui/compose/performance/tooling) available to help you measure\nand analyze your Compose app's performance.\n\nBest Practices\n--------------\n\nWhen developing your app with Compose, keep these best practices in mind:\n\n- **[Avoid expensive calculations](/develop/ui/compose/performance/bestpractices#use-remember):** Use `remember` to cache the results of expensive calculations.\n- **[Help lazy layouts](/develop/ui/compose/performance/bestpractices#use-lazylist-keys):** Provide stable keys to lazy layouts using the `key` parameter to minimize unnecessary recompositions.\n- **[Limit unnecessary recompositions](/develop/ui/compose/performance/bestpractices#use-derivedstateof):** Use `derivedStateOf` to limit recompositions when rapidly changing state.\n- **[Defer state reads](/develop/ui/compose/performance/bestpractices#defer-reads):** Defer state reads as long as possible by wrapping them in lambda functions.\n- **[Use lambda modifiers for changing state](/develop/ui/compose/performance/bestpractices#defer-reads):** Use lambda-based modifiers like `Modifier.offset { ... }` for frequently changing state variables.\n- **[Avoid backwards writes](/develop/ui/compose/performance/bestpractices#avoid-backwards):** Never write to state that has already been read in a composable.\n\nFor more details, see the [best practices](/develop/ui/compose/performance/bestpractices) guide.\n\nViews\n-----\n\nIf you are working with views instead of Compose, see the dedicated [Improve\nlayout performance](/develop/ui/views/layout/improving-layouts) guide.\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."]]