Setup Baseline Profile (#8135)

* Setup Baseline Profile

Adds Baseline Profile generator and startup time test.
Readme included in macrobenchmark module to run the generator.

* changes
This commit is contained in:
Ivan Iskandar
2022-10-04 20:22:55 +07:00
committed by GitHub
parent bbe1608006
commit 3b62396442
12 changed files with 17301 additions and 1 deletions

View File

@@ -75,10 +75,20 @@ android {
applicationIdSuffix = debugType.applicationIdSuffix
matchingFallbacks.add("release")
}
create("benchmark") {
initWith(getByName("release"))
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks.add("release")
isDebuggable = false
versionNameSuffix = "-benchmark"
applicationIdSuffix = ".benchmark"
}
}
sourceSets {
getByName("preview").res.srcDirs("src/debug/res")
getByName("benchmark").res.srcDirs("src/debug/res")
}
flavorDimensions.add("default")
@@ -193,6 +203,7 @@ dependencies {
implementation(androidx.recyclerview)
implementation(androidx.viewpager)
implementation(androidx.glance)
implementation(androidx.profileinstaller)
implementation(androidx.bundles.lifecycle)
@@ -282,6 +293,15 @@ dependencies {
implementation(libs.leakcanary.plumber)
}
androidComponents {
beforeVariants { variantBuilder ->
// Disables standardBenchmark
if (variantBuilder.buildType == "benchmark") {
variantBuilder.enable = variantBuilder.productFlavors.containsAll(listOf("default" to "dev"))
}
}
}
tasks {
withType<Test> {
useJUnitPlatform()

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- Internet -->
<uses-permission android:name="android.permission.INTERNET" />
@@ -37,6 +38,11 @@
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config">
<!-- enable profiling by macrobenchmark -->
<profileable
android:shell="true"
tools:targetApi="q" />
<activity
android:name=".ui.main.MainActivity"
android:launchMode="singleTop"

17088
app/src/main/baseline-prof.txt Normal file

File diff suppressed because it is too large Load Diff