Status Update
Comments
cc...@google.com <cc...@google.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
cc...@google.com <cc...@google.com> #3
ra...@google.com <ra...@google.com>
ra...@google.com <ra...@google.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
cc...@google.com <cc...@google.com>
cc...@google.com <cc...@google.com> #5
The current dropShaderCache implementation doesn't work on root or user builds.
I added a trace section metric for cache_miss/cache_hit (traced by Skia for shader compilation), and see that on rooted devices, without uninstall/reinstall, the shader gets compiled and left in place:
## Compilation reset with pm compile --reset
SmallListStartupBenchmark_startup[startup=COLD,compilation=None]
cache_hitMs min 1.4, median 1.4, max 1.5
cache_missMs min 0.0, median 0.0, max 0.0
timeToInitialDisplayMs min 240.0, median 255.4, max 273.7
Traces: Iteration 0 1 2 3 4 5 6 7 8 9
SmallListStartupBenchmark_startup[startup=COLD,compilation=WarmupProfile(iterations=3)]
cache_hitMs min 1.3, median 1.4, max 3.0
cache_missMs min 0.0, median 0.0, max 0.0
timeToInitialDisplayMs min 190.6, median 202.7, max 211.4
Traces: Iteration 0 1 2 3 4 5 6 7 8 9
SmallListStartupBenchmark_startup[startup=COLD,compilation=Full]
cache_hitMs min 1.4, median 1.4, max 3.1
cache_missMs min 0.0, median 0.0, max 0.0
timeToInitialDisplayMs min 222.8, median 232.5, max 257.5
Traces: Iteration 0 1 2 3 4 5 6 7 8 9
While when the reinstall is used, we sometimes hit shader compilation (cache_miss), and sometimes don't, which is affected by how long the app stays alive.
## Compilation reset with uninstall + reinstall
SmallListStartupBenchmark_startup[startup=COLD,compilation=None]
cache_hitMs min 0.0, median 0.0, max 0.0
cache_missMs min 22.1, median 22.6, max 24.0
timeToInitialDisplayMs min 258.6, median 264.6, max 276.4
Traces: Iteration 0 1 2 3 4 5 6 7 8 9
SmallListStartupBenchmark_startup[startup=COLD,compilation=WarmupProfile(iterations=3)]
cache_hitMs min 1.4, median 1.4, max 1.4
cache_missMs min 0.0, median 0.0, max 0.0
timeToInitialDisplayMs min 191.4, median 195.9, max 214.7
Traces: Iteration 0 1 2 3 4 5 6 7 8 9
SmallListStartupBenchmark_startup[startup=COLD,compilation=Full]
cache_hitMs min 0.0, median 0.0, max 0.0
cache_missMs min 22.3, median 23.3, max 23.8
timeToInitialDisplayMs min 232.2, median 245.7, max 262.9
Traces: Iteration 0 1 2 3 4 5 6 7 8 9
In trivially quick cold startup tests, where the process is killed quickly, we see the shaders never get a chance to compile. With warmup profiles, where the app is alive for a while (and they have time to be written to disk) they do.
This currently makes warmup iterations look better than they should.
Only fix I have figured out on user builds is broadcasting to the app to delete shaders, since on user builds shell doesn't have access to the shader cache dir.
ap...@google.com <ap...@google.com> #6
Branch: androidx-main
commit d5fb7b68ab904d904c21cbb8ce0bf497979ff6a1
Author: Chris Craik <ccraik@google.com>
Date: Tue Oct 18 14:16:36 2022
Add summing mode to TraceSectionMetric
Test: TraceSectionMetricTest
Relnote: """
Added TraceSectionMode("label", Mode.Sum), allowing measurement of
total time spent on multiple trace sections with the same label. For
instance, TraceSectionMetric("inflate", Mode.Sum) will report a metric
`inflateMs` for the total time in a trace spent on inflation.
Also removed API requirement, as TraceSectionMetric works together
with androidx.tracing.Trace back to lower API levels, with the use of
[forceEnableAppTracing](
"""
Additionally adds tracing of cache_miss and cache_hit for observing
cost of shader compilation for
Change-Id: Id7b68e23f5ded4d20ab21771dbf9eb96d9dcfdb7
M benchmark/benchmark-macro/api/public_plus_experimental_current.txt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/TraceSectionMetricTest.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Metric.kt
M compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/SmallListStartupBenchmark.kt
M testutils/testutils-macrobenchmark/src/main/java/androidx/testutils/MacrobenchUtils.kt
ap...@google.com <ap...@google.com> #7
Branch: androidx-main
commit 0ba5c3dad9652a85319894f9aa7ad52664be72d2
Author: Chris Craik <ccraik@google.com>
Date: Tue Oct 18 20:56:23 2022
Fix deleteShaderCache by using Profileinstaller or fallback correctly with root
Test: SmallListStartupBenchmark
Test: MacrobenchmarkScopeTest
Fixes: 231455742
Relnote: """
BENCHMARK RELEASE NOTES
Fixed MacrobenchmarkScope.dropShaderCache(). This removes roughly 20ms
of noise from StartupMode.COLD benchmarks, as shaders are now
consistently cleared each iteration. Previously, `Partial` compilation
using warmup iterations would report incorrectly fast numbers, as
shader caching was more likely to happen during warmup. This fix
requires either a rooted device, or using
`profileinstaller:1.3.0-alpha02` in the target app.
PROFILEINSTALLER RELEASE NOTES
Added a hook for benchmarks to drop the shader cache, to ensure
consistent performance for cold startups, especially when compiling
with profiles from warmup iterations. This update is required to
measure cold startups using `benchmark-macro-junit4:1.2.0-alpha05` or
later.
"""
Change-Id: Ia5171b0f40dd8ce6f64f5ccf0a33281a4d8b121e
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkScopeTest.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MacrobenchmarkScope.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/ProfileInstallBroadcast.kt
M profileinstaller/profileinstaller/api/current.txt
M profileinstaller/profileinstaller/api/public_plus_experimental_current.txt
M profileinstaller/profileinstaller/api/restricted_current.txt
A profileinstaller/profileinstaller/src/main/java/androidx/profileinstaller/BenchmarkOperation.java
M profileinstaller/profileinstaller/src/main/java/androidx/profileinstaller/ProfileInstallReceiver.java
M profileinstaller/profileinstaller/src/main/java/androidx/profileinstaller/ProfileInstaller.java
na...@google.com <na...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-macro:1.2.0-alpha07
androidx.profileinstaller:profileinstaller:1.3.0-alpha02
Description
Alert on dashboard:https://androidx-perf.skia.org/t/?begin=1651608277&end=1651608278&subset=all
CLs in build:https://android-build.googleplex.com/builds/jump-to-build/8534762
Caused byhttps://android-review.googlesource.com/c/platform/frameworks/support/+/2086023/ - Improve macrobench iter speed by optimizing shell commands
Regression only affects baseline profile and full compilation variants of cold startup benchmarks.
Need to see if this makes the numbers more or less correct, and why. Triaging to 1.1 for this reason.