mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 22:17:03 +05:30
fix(benchmark): rework baseline profile benchmark
This commit is contained in:
parent
7c59130af9
commit
0d78cb4112
1 changed files with 11 additions and 10 deletions
|
@ -8,6 +8,7 @@ package dev.msfjarvis.claw.benchmark
|
|||
|
||||
import androidx.benchmark.macro.BaselineProfileMode
|
||||
import androidx.benchmark.macro.CompilationMode
|
||||
import androidx.benchmark.macro.FrameTimingMetric
|
||||
import androidx.benchmark.macro.StartupMode
|
||||
import androidx.benchmark.macro.StartupTimingMetric
|
||||
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
|
||||
|
@ -28,27 +29,27 @@ class BaselineProfileBenchmark {
|
|||
}
|
||||
|
||||
@Test
|
||||
fun startupNoCompilation() {
|
||||
startup(CompilationMode.None())
|
||||
fun noCompilation() {
|
||||
exploreUI(CompilationMode.None())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun startupBaselineFullyCompiled() {
|
||||
startup(CompilationMode.Full())
|
||||
fun fullyCompiled() {
|
||||
exploreUI(CompilationMode.Full())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun startupBaselineProfile() {
|
||||
startup(CompilationMode.Partial(baselineProfileMode = BaselineProfileMode.Require))
|
||||
fun baselineProfile() {
|
||||
exploreUI(CompilationMode.Partial(baselineProfileMode = BaselineProfileMode.Require))
|
||||
}
|
||||
|
||||
private fun startup(compilationMode: CompilationMode) {
|
||||
private fun exploreUI(compilationMode: CompilationMode) {
|
||||
benchmarkRule.measureRepeated(
|
||||
packageName = PACKAGE_NAME,
|
||||
metrics = listOf(StartupTimingMetric()),
|
||||
iterations = 10,
|
||||
metrics = listOf(FrameTimingMetric(), StartupTimingMetric()),
|
||||
compilationMode = compilationMode,
|
||||
startupMode = StartupMode.COLD,
|
||||
compilationMode = compilationMode
|
||||
iterations = 10,
|
||||
) {
|
||||
device.executeShellCommand("pm clear $PACKAGE_NAME")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue