Add deterministic Baseline Profile generation and startup benchmarks #294 - #353
Conversation
- Introduced a new baseline profile module with necessary configurations and dependencies. - Updated `build.gradle.kts` to include baseline profile support and related plugins. - Added new test classes for generating and benchmarking baseline profiles. - Updated `settings.gradle.kts` to include the baseline profile module. - Adjusted dependencies in `gradle/libs.versions.toml` for compatibility with new features.
- Added new product flavors: `live` and `fixture` in `build.gradle.kts` to support different backend implementations. - Created `FixtureMarketsApi` to simulate market data for testing purposes. - Updated `BackendModules.kt` for both `live` and `fixture` flavors to include respective data sources. - Introduced baseline profile configurations to enhance performance profiling. - Adjusted dependencies and application initialization to accommodate the new mock backend setup.
|
Claude finished @Kaaveh's task in 2m 24s —— View job Code Review
SummaryThis is a well-structured PR that adds deterministic Baseline Profile generation and startup benchmarks. The core approach — isolating the fixture API in a separate product flavor, filtering fixture-only classes from the profile rules, and reporting TTFD via Issues🔴 Hardcoded package name in
|
- Included the baseline profile module in `settings.gradle.kts`. - Updated the CI workflow to assemble the baseline profile variant. - Adjusted Java compatibility to version 17 in `baselineprofile/build.gradle.kts`. - Enhanced the `BaselineProfileGenerator` to dynamically handle target package permissions based on API level. - Refined the `MarketListScreen` logic for better loading state management.
|
@Kaaveh |
|
@claude let's review the new changes again |
|
Claude finished @Kaaveh's task in 1m 43s —— View job Code Review (Updated)
All previously raised issues have been addressed. Here's the status on each: Previously Identified Issues — All Fixed ✅🔴 Hardcoded package name → Fixed
private val targetPackage: String
get() = InstrumentationRegistry.getArguments().getString("targetAppId")
?: error("targetAppId instrumentation argument not set")The 🔴 Stale commented-out include in
|
|
Hi @Kaaveh, we have two possible approaches for keeping the Baseline Profiles up to date: 1. Keep profile generation manualWe can keep the current CI setup and regenerate the profiles manually whenever a change affects startup, navigation, or another critical user journey. The developer making the change should run: ./gradlew :app:generateBaselineProfileIf the generated profile files change, they should review and commit them. When needed, performance benchmarks can be run separately on a physical device: ./gradlew :baselineprofile:connectedFixtureBenchmarkReleaseAndroidTest2. Automate profile generation in GitHub ActionsWe can add a CI job that:
The disadvantage is the additional CI time and cost. GitHub-hosted jobs run on fresh VMs, and Android system images are not covered by our existing Gradle cache. Unless we add a separate cache, use a custom runner image, or use a persistent self-hosted runner, the job will need to download the Android system image again. It must then create and boot the emulator, build the app, and execute the profile generator. Because of this overhead, running profile generation for every PR may not be worthwhile. I suggest keeping profile generation manual for now:
|
|
Yes, I agree with your suggestion. |
Summary
Adds deterministic Baseline Profile generation and startup performance benchmarking for the Android application.
baselineprofilemodule.liveandfixturebackend flavors.InstantiatableLint false positive.Motivation
Baseline Profile generation executes critical user journeys multiple times. Using the production API made generation unreliable because of its rate limit.
The fixture backend provides consistent paging data while keeping the production repository, database, domain, ViewModel, and Compose UI paths active.
Validation
Commands used: