Android Calendar팀이 기준 프로필을 사용하여 앱 시작과 버벅거림을 개선한 방법
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
기준 프로필은
인터프리터 및 JIT (Just-In-Time) 컴파일
단계
살펴봤습니다 기준 프로필을 사용하면 원하는 사용자 여정을 선택할 수 있습니다.
최적화하고자 하며 앱 시작을 개선하고 버벅거림을 줄이는 등의 작업을 수행하는 데 도움이 될 수 있습니다.
결과적으로 사용자 유지 및 평점과 같은 비즈니스 측정항목이 개선됩니다.
기준에 대해 자세히 알아보기
프로필을 선택합니다.
Android Calendar 팀은 기준 프로필을 구현했고 약 20% 의 앱을 관찰했습니다.
시작 시간이 개선되고 느린 프레임이나 정지된 프레임이 약 50% 감소했습니다. 그 내용은 다음과 같습니다.
이러한 성과를 달성하기 위해 무엇을 했는지,
영향을 측정하는 방식에 기준 프로필을 사용하기로 결정했습니다.
클라우드 프로필 vs. 기준 프로필
Android 캘린더 팀은 이미 Cloud
프로필을 참조하세요.
실제 사용자를 기반으로 한 또 다른 프로필 기반 최적화 (PGO) 방법입니다.
앱 상호작용을
수행할 수 있습니다 클라우드 프로필과 기준 프로필을 만드는 방법은 다음과 같습니다.
비교:
프로필 유형 |
설정 |
사용자 여정 포함 |
사용자층이 다음과 같을 때 가장 효과적 |
효과 실현 |
지원되는 Android 버전 |
클라우드 프로필 |
기본적으로 사용 설정됨 |
실제 사용자 데이터를 기반으로 자동으로 선택됨 |
크게 |
며칠 이내 |
Android 9(API 수준 28) 이상 |
기준 프로필 |
내가 설정함 |
사용자가 선택 |
모든 크기 |
즉시 |
Android 7 (API 수준 24) 이상 |
Android Calendar 팀이 기준 프로필을 추가하기로 결정한 주된 이유 중 하나는
코드베이스가 더 빨라진 주간 릴리스 주기로 전환되었기 때문이었습니다.
클라우드 프로필을 사용하면 성능이 크게 향상되지만 1~2일이 소요됩니다.
기대하는 만큼의 효과를 극대화하기 위해
실제 사용자 데이터를 집계하는 데 사용됩니다. 기준으로 클라우드 프로필 보완
프로필을 통해 사용자는 최대 성능 개선을 경험할 수 있는 시간을 더 확보할 수 있습니다.
한 번 더 확인해 보세요.
또한 Android 캘린더 팀이 다음 작업을 할 수 있는 것이 중요했습니다.
구체적으로 어떤 중요한 사용자 여정 (CUJ)을
이는 기준 프로필을 사용하여 수행할 수 있습니다.
일반적으로 클라우드 프로필 외에 기준 프로필을 사용하는 것이 좋습니다.
최상의 실적을 얻을 수 있도록 기본적으로 사용 설정됩니다.
사용자 여정 포함
Android 캘린더팀은 기준 프로필에 두 개의 CUJ를 포함하기로 선택했습니다.
- 일정 보기에서 앱 열기: 처음에는 기본 보기이므로
앱을 처음 사용하거나 변경하지 않은 사용자에 맞춰
기본 설정입니다.
- 월간 일정 보기에서 앱 열기: 사용자별로 많은 사용자에게 선택된 보기
데이터를 수집하는 데 사용됩니다 사용자가 앱을 사용하는 방식을 추적하려면
Firebase
일반적으로 비즈니스에 수익성이 있는 CUJ를 추가해야 합니다.
가장 일반적인 CUJ가 포함될 수 있습니다. 선택 방법을 자세히 알아보려면
최적화할 CUJ는
포함됩니다.
구현
Android 캘린더 팀은 내부 래퍼를 사용하여
Jetpack Macrobenchmark 라이브러리
내부 도구 및
일반적인 확장성을 제공합니다
다음은 일정에서 앱을 열기 위한 Macrobenchmark 테스트 구성입니다.
보기:
@Test
fun generateProfile() =
baselineProfileRule.collect(PACKAGE_NAME, includeInStartupProfile = true) {
startActivityAndWait()
// Verify pre-existing recurring events and tasks are shown.
device.waitAndFindObject(By.text("Recurring event"), 20_000)
device.waitAndFindObject(By.text("Recurring task"), 20_000)
// Open drawer and verify selected view.
device.findObject(By.desc("Show Calendar List and Settings drawer")).click()
device.waitAndFindObject(By.desc("Schedule view, Selected"), 1_000)
}
통제된 출시를 사용한 영향 측정
기준 프로필은 함께 제공되는 APK와 밀접하게 결합되어 있으므로
앱이 실행되기 전에 통합되는 경우 표준 A/B를 실행하는 것은 불가능합니다.
그 영향을 파악할 수 있습니다 하지만 Android 캘린더 팀은
통제되는 버전을 사용하여 영향을 정확하게 측정할 수 있습니다.
기본적으로 일부 사용자에게만 새 앱 버전을 출시하고
이전 버전과 유사한 버전을 사용 중인
사용자에게만 제공됩니다
기준 프로필을 사용한 결과 다음과 같은 효과를 즉각적으로
여러 영역에서 개선을 거쳤습니다 이러한 통계는 전 세계적으로
일정 및 월간 일정 보기를 시작하는 모든 사용자의 기기 비율
사용자가 혜택을 얻을 가능성이 가장 크지만 다른 사용자도 혜택을
캘린더 데이터 로드와 같은 공유 프로세스 최적화
데이터베이스입니다.
- 대화형 앱 시작 (가장 일반적인 시나리오) 지연 시간 중앙값
775ms~644ms (17%)
- 콜드 스타트 지연 시간 중앙값이 1,058ms에서 901ms (15%)로 감소
- 웜 스타트 지연 시간 중앙값이 453ms에서 378ms (17%)로 감소
- 일정 및 월간 조회수에서 버벅거리는 프레임 속도 중앙값 42~60% 감소
클라우드 프로필을 기준과 함께 사용하는 경우
프로필의 경우 시간이 지남에 따라 개선되는 정도가
Cloud 프로필이 생성됩니다 하지만 여전히
다른 기능 외에 기준 프로필을 사용하여 상당한 성능 향상
최적화해 보겠습니다.
도구와 기능에 관한 자세한 내용은 다음 리소스를 참고하세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 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,["# How the Android Calendar team improved app startup and jank with Baseline Profiles\n\nBaseline Profiles improve code execution speed by up to 30% by avoiding\ninterpreter and just-in-time (JIT) [compilation\nsteps](https://source.android.com/docs/core/runtime/jit-compiler#architectural-overview)\nfor common user journeys. Baseline Profiles let you choose the user journeys you\nwant to optimize and can help improve app startup, reduce jank, and more---which\nin turn result in improved business metrics, such as user retention and ratings.\n[Learn more about Baseline\nProfiles](/topic/performance/baselineprofiles/overview).\n\nThe Android Calendar team implemented Baseline Profiles and observed \\~20% app\nstartup time improvement and \\~50% reduction in slow or frozen frames. Here's\nwhat they did end-to-end to achieve these performance wins, from why they\ndecided to use Baseline Profiles to how they measured impact.\n\nCloud Profiles v. Baseline Profiles\n-----------------------------------\n\nThe Android Calendar team had already been using [Cloud\nProfiles](/topic/performance/baselineprofiles/overview#cloud-profiles), which\nare another Profile Guided Optimization (PGO) method based on real-world user\ninteractions with the app. Here's how Cloud Profiles and Baseline Profiles\ncompare:\n\n| Profile type | Set up | User journeys included | Works best when user base is | Impact realized | Supported Android versions |\n|-------------------|--------------------|----------------------------------------------------|------------------------------|----------------------|-------------------------------------|\n| Cloud Profiles | Enabled by default | Chosen automatically based on real-world user data | Large | Within a couple days | Android 9 (API level 28) and higher |\n| Baseline Profiles | Configured by you | Chosen by you | All sizes | Immediate | Android 7 (API level 24) and higher |\n\nOne key reason the Android Calendar team decided to add Baseline Profiles to\ntheir codebase was because they were moving to a faster, weekly release cycle.\nWhile Cloud Profiles provide significant performance gains, it takes 1-2 days\nafter app launch for them to reach their peak impact because they rely on\naggregating real-world user data. Supplementing Cloud Profiles with Baseline\nProfiles gives users more time to experience peak performance improvements\nbefore the next app version rolls out.\n\nAdditionally, it was important for the Android Calendar team to be able to\nchoose which critical user journeys (CUJs) specifically are included in the\nprofile, which you can do using Baseline Profiles.\n\nGenerally, we recommend using Baseline Profiles in addition to Cloud Profiles,\nenabled by default, for the best performance outcomes.\n\nUser journeys included\n----------------------\n\nThe Android Calendar team chose to include two CUJs in their Baseline Profiles:\n\n- Opening the app in schedule view: initially the default view, so important to optimize for users using the app for the first time or who don't change the default settings.\n- Opening the app in month view: the chosen view for many users, based on user data. To track how users are using your app, you can use tools such as [Firebase](https://firebase.google.com/docs/analytics).\n\nGenerally, you should add the CUJs that are profitable for the business (if\napplicable) and CUJs that are most common. To learn more about how to choose\nCUJs to optimize, see [What to\ninclude](/topic/performance/baselineprofiles/overview#what-to-include).\n\nImplementation\n--------------\n\nThe Android Calendar team uses an internal wrapper for the\n[Jetpack Macrobenchmark library](/topic/performance/baselineprofiles/measure-baselineprofile)\nto generate Baseline Profiles for ease of integration with internal tools and\ngeneral scalability.\n\nHere's the Macrobenchmark test configuration for opening the app in schedule\nview: \n\n @Test\n fun generateProfile() =\n baselineProfileRule.collect(PACKAGE_NAME, includeInStartupProfile = true) {\n startActivityAndWait()\n // Verify pre-existing recurring events and tasks are shown.\n device.waitAndFindObject(By.text(\"Recurring event\"), 20_000)\n device.waitAndFindObject(By.text(\"Recurring task\"), 20_000)\n\n // Open drawer and verify selected view.\n device.findObject(By.desc(\"Show Calendar List and Settings drawer\")).click()\n device.waitAndFindObject(By.desc(\"Schedule view, Selected\"), 1_000)\n }\n\nMeasure impact using controlled releases\n----------------------------------------\n\nSince Baseline Profiles are tightly coupled with the APK they're shipped with\nand incorporated before your app runs, it's not possible to run a standard A/B\nexperiment to understand their impact. However, the Android Calendar team was\nable to get an accurate measure of impact using *controlled releases*, where you\nessentially release the new app version to only a subset of users and compare\nthem to users who are on a version similar to the previous release.\n\nWith Baseline Profiles, they saw the following immediate, significant\nimprovements in multiple areas. These stats are aggregated across a wide range\nof devices and across all users---those who start in schedule and month view\nlikely gain the biggest benefits, but other users also benefit due to the\noptimization of shared processes such as loading calendar data from the\ndatabase.\n\n- Median interactive app startup (most common scenario) latency decreased from 775ms to 644ms (17%)\n- Median cold start latency decreased from 1,058ms to 901ms (15%)\n- Median warm start latency decreased from 453ms to 378ms (17%)\n- Median janky frame rate decreased by 42-60% in schedule and month views\n\nKeep in mind that if you use Cloud Profiles in conjunction with Baseline\nProfiles you'll likely see the improvements decrease slightly over the course of\nthe first week, as Cloud Profiles are generated. However, you should still\nobserve significant performance gains with Baseline Profiles on top of other\noptimizations you have in place.\n\nTo learn more about the tools and features, see the following resources:\n\n- [About Baseline Profiles](/topic/performance/baselineprofiles/overview)\n- [Benchmark Baseline Profiles with Macrobenchmark\n library](/topic/performance/baselineprofiles/measure-baselineprofile)"]]