- name: Clean Managed Devices
run: ./gradlew cleanManagedDevices --unused-only
- name: Generate Baseline Profile
run: |
./gradlew :benchmark:pixel2Api31BenchmarkAndroidTest -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile -Dorg.gradle.workers.max=4
pixel2Api31
: devices 옵션에서 정의한 이름 -Pandroid.testoptions.manageddevices.emulator.gpu
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules
@get:Rule val baselineProfileRule = BaselineProfileRule()
- name: Move & Rename Baseline Profiles
run: |
mv -f benchmark/build/outputs/managed_device_android_test_additional_output/pixel2Api31/ExampleStartupBenchmark_startup-baseline-prof.txt app/src/main/baseline-prof.txt
ExampleStartupBenchmark_startup-baseline-prof.txt
ExampleStartupBenchmark
은 benchmark를 수행할 클래스명baseline-prof.txt
baseline-prof.txt
이름으로 이 위치로 이동
1. 생각보다 Baseline Profile 생성이 꽤 오래 걸림
2. 프로덕션 배포 시 까먹지 않아서 좋음