java.lang.RuntimeException: Baseline profiles aren't supported on this device version at androidx.benchmark.macro.CompilationMode $Partial.broadcastBaselineProfileInstall(CompilationMode.kt:261) at androidx.benchmark.macro.CompilationMode $Partial.compileImpl$benchmark_macro_release(CompilationMode.kt:285) at androidx.benchmark.macro.CompilationMode.resetAndCompile $benchmark_macro_release(CompilationMode.kt:73) at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmark
{ class Incremental(val dirtyFiles: DirtyFilesContainer) : CompilationMode() class Rebuild(val reason : BuildAttribute) : CompilationMode() } 编译模式无非就是增量编译和全量编译。 : return CompilationMode.Rebuild(BuildAttribute.NO_BUILD_HISTORY) 如果读取不到 lastBuildinfo, 会触发全量。 返回的 CompilationMode.Incremental(dirtyFiles), 不过新的疑惑来了,这里的 dirtyFlles 表示的是什么呢? : emptyList() val newDiff = if (compilationMode is CompilationMode.Incremental) { BuildDifference
benchmarkRule.measureRepeated( packageName = "com.example.myapp", metrics = listOf(StartupTimingMetric()), compilationMode = CompilationMode.None(), // 无 AOT,纯解释执行 iterations = 10, startupMode = StartupMode.COLD, setupBlock = CompilationMode.Partial( baselineProfileMode = BaselineProfileMode.Require ), iterations = 10, startupMode = CompilationMode.Full(), // 全量 AOT iterations = 10, startupMode = StartupMode.COLD, setupBlock = { Macrobenchmark 的 CompilationMode 参数就是解决这个问题的,但手动测试时容易忽略。 坑3:设备温度影响 手机跑 benchmark 时间长了会发热,触发降频。
我们只需要在PageParserPath加入下面的代码 <PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript