Status Update
Comments
ap...@google.com <ap...@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
sj...@google.com <sj...@google.com>
cc...@google.com <cc...@google.com> #3
ap...@google.com <ap...@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
ap...@google.com <ap...@google.com> #5
Branch: androidx-master-dev
commit 5d2b205ca996b1cf37a28daa342ffbffb481b887
Author: Chris Craik <ccraik@google.com>
Date: Mon Nov 02 13:27:41 2020
Add benchmark for measuring overhead of Perfetto trace capture
Bug: 171749803
Bug: 145598917
Test: PerfettoOverheadBenchmark
Will also help us validate PerfettoRule capture in CI.
Sample benchmark measurements (Pixel2 locked clocks):
11 ns 0 allocs PerfettoOverheadBenchmark.empty
287 ns 0 allocs PerfettoOverheadBenchmark.runWithTimingDisabled
4,958 ns 0 allocs PerfettoOverheadBenchmark.traceBlock
4,832 ns 0 allocs PerfettoOverheadBenchmark.traceBeginEnd
Change-Id: I1c74fb14f3a13ba10d7ea6f9ff37f450e69aa54e
M benchmark/benchmark/build.gradle
A benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/PerfettoOverheadBenchmark.kt
cc...@google.com <cc...@google.com> #6
While the CL in #5 was reverted, and is in the process of being
Looks like API 29 is having issues writing to output directory though, which started before that change landed.
cc...@google.com <cc...@google.com> #7
Looks like it was caused by enabling benchmark output:
IIRC, we only tested that with forrest runs on API 28. Fix
ap...@google.com <ap...@google.com> #8
Branch: androidx-master-dev
commit 4724b1f55919968f2a486da5f8f8b064927911cf
Author: Chris Craik <ccraik@google.com>
Date: Tue Nov 03 14:45:09 2020
Add requestLegacyExternalStorage to benchmarks
Bug: 145598917
Test: ./gradlew benchmark:b-b:installRelease && adb shell am instrument -w -r -e debug false -e newRunListenerMode true -e class 'androidx.benchmark.benchmark.TrivialJavaBenchmark' -e androidx.benchmark.output.enable true -e listener androidx.benchmark.junit4.InstrumentationResultsRunListener androidx.benchmark.benchmark.test/androidx.benchmark.junit4.AndroidBenchmarkRunner
Turning on benchmark output has caused benchmarks to start crashing on
API 29, due to inability to access output dir.
Note: unable to reproduce this crash on my local Q device, even with
manual am instrument command above
Change-Id: Ib19ec37ec10046b493c8b44207aab0ce93ad24b6
M ads/ads-identifier-benchmark/src/androidTest/AndroidManifest.xml
M appcompat/appcompat-benchmark/src/androidTest/AndroidManifest.xml
M benchmark/benchmark/src/androidTest/AndroidManifest.xml
M collection/collection-benchmark/src/androidTest/AndroidManifest.xml
M navigation/benchmark/src/androidTest/AndroidManifest.xml
M recyclerview/recyclerview-benchmark/src/androidTest/AndroidManifest.xml
M room/benchmark/src/androidTest/AndroidManifest.xml
M slices/benchmark/src/androidTest/AndroidManifest.xml
M work/workmanager-benchmark/src/androidTest/AndroidManifest.xml
cc...@google.com <cc...@google.com> #9
We've got initial traces in CI! For example,
Current Constraints:
- only captured on API 29: Pixel 2016 (can support 28, with some
)additional work - only small subset of benchmarks capture a trace, due to overhead (
)b/171749803
Next step is to capture traces for all benchmarks with app tag disabled. This will mean no e.g. compose trace sections will be captured, but it will allow us to see CPU usage, thread scheduling, GCs, etc. We'll keep the app tag enabled on the *WithTracing
variants.
ap...@google.com <ap...@google.com> #10
Branch: androidx-main
commit f5d35eb9ca852dfac791c2dc1d6ce953b2843880
Author: Chris Craik <ccraik@google.com>
Date: Wed Aug 11 17:35:21 2021
Move perfetto capture and protos to benchmark-common
Test: ./gradlew benchmark:benchmark-common:cC benchmark:benchmark-macro:cC benchmark:benchmark-macro-junit4:cC benchmark:benchmark-junit4:cC
Bug: 196115387
Bug: 145598917
Relnote: N/A
PerfettoTraceProcessor and its binary will stay in benchmark-macro.
Moves PerfettoRule to benchmark-junit, so that microbenchmarks don't
need to depend on benchmark-macro-junit4. Eventually, this
functionality can be merged into BenchmarkRule, as long as
in-process/app tag tracing is configurable, and off by
default. UserspaceTracing will enable us to still capture
BenchmarkState lifecycle events, like different modes (warmup /
measure / allocation count).
This unblocks raising the minAPI of Macrobench to the long-term goal
of API 21, which is the lowest that can support shell commands, as
well as perfetto capture.
This change also moves a few supporting classes, such as DeviceInfo
and ConfigurationError, which were always intended to gradually
replace benchmark-common's error / device state querying. This starts
that process.
As testutils-ktx is used by benchmark-common now, add to all project
config flavors.
Change-Id: I6559b6735d0106e38ec5d8eaeddcac9297d0c431
M benchmark/benchmark-common/api/current.txt
M benchmark/benchmark-common/api/public_plus_experimental_current.txt
M benchmark/benchmark-common/api/restricted_current.txt
M benchmark/benchmark-common/build.gradle
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ConfigurationErrorTest.kt
A benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/Packages.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellBehaviorTest.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellTest.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/UserspaceTracingTest.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/AtraceTagTest.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/PerfettoConfigTest.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/UiStateTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/ConfigurationError.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/DeviceInfo.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/UserspaceTracing.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/AtraceTag.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCapture.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoConfig.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoHelper.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/UiState.kt
M benchmark/benchmark-common/src/main/java/perfetto/protos/package-info.java
M benchmark/benchmark-common/src/main/proto/perfetto_config.proto
M benchmark/benchmark-common/src/main/proto/perfetto_trace.proto
M benchmark/benchmark-junit4/api/current.txt
M benchmark/benchmark-junit4/api/public_plus_experimental_current.txt
M benchmark/benchmark-junit4/api/restricted_current.txt
M benchmark/benchmark-junit4/build.gradle
M benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/PerfettoRuleTest.kt
M benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/PerfettoRule.kt
M benchmark/benchmark-macro-junit4/api/current.txt
M benchmark/benchmark-macro-junit4/api/public_plus_experimental_current.txt
M benchmark/benchmark-macro-junit4/api/restricted_current.txt
M benchmark/benchmark-macro/api/current.txt
M benchmark/benchmark-macro/api/public_plus_experimental_current.txt
M benchmark/benchmark-macro/api/restricted_current.txt
M benchmark/benchmark-macro/build.gradle
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/FileLinkingRule.kt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/StartupTimingMetricTest.kt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoCaptureTest.kt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoTraceProcessorTest.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/CompilationMode.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoTraceProcessor.kt
M benchmark/benchmark/build.gradle
M benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/PerfettoOverheadBenchmark.kt
M buildSrc/private/src/main/kotlin/androidx/build/uptodatedness/TaskUpToDateValidator.kt
M compose/ui/ui-graphics/benchmark/build.gradle
M compose/ui/ui-graphics/benchmark/src/androidTest/java/androidx/compose/ui/graphics/benchmark/VectorBenchmarkWithTracing.kt
M development/build_log_simplifier/messages.ignore
M settings.gradle
cc...@google.com <cc...@google.com> #11
I see the next step here being to always enable tracing, but to disable the app tag. Just need to use something (like ForceTracing, which just landed in macrobench) to ensure high level lifecycle events are captured.
ap...@google.com <ap...@google.com> #12
Branch: androidx-main
commit ec8b0e22b5e2415f1c165d5ff1b9e73fff4b956b
Author: Chris Craik <ccraik@google.com>
Date: Fri Nov 19 14:52:10 2021
Capture Perfetto traces during Microbenchmarks
Bug: 205636583
Fixes: 145598917
Test: ./gradlew benchmark-common
Relnote: "Add low-overhead System Tracing to microbench output on
Android Q (API 29+). Note that this does not currently capture custom
tracing (via android.os.Trace or androidx.tracing Jetpack APIs) to
avoid affecting results. This tracing should be useful in diagnosing
instability, especially from sources outside the benchmark."
Uses same timing information as microbench itself to generate
userspace tracing information, which is appended into a captured
perfetto trace.
Eventually this approach could enable other metrics available in
traces (such as time a thread is running vs not).
This approach has multiple drawbacks/constraints currently:
* Ignores calls to Trace.beginSection/endSection
* These have been found to be too high overhead in common
scenarios to be on by default. Turning it on drastically affected
many compose benchmarks.
* Eventually we can either make app tracing tag configurable,
offer microbenchmark-specific userspace tracing (easier than
general case, since we can append manually), or offer a more
general userspace tracing solution (which would also be much
lower overhead).
* Puts microbench library tracing in separate track, separate from
the app process
* This can be fixed with improvements to the proto generation to
pick the correct track id, given the test TID .
* Only traces with bundled perfetto (API 29+)
* If deemed useful enough, we can use unbundled perfetto as well
(move perfetto tracebox from benchmark-macro to benchmark-common)
Change-Id: I298be3c9f9f7ef9ba1d2c63d79c864e8c8b16e04
M benchmark/benchmark-junit4/api/current.txt
M benchmark/benchmark-junit4/api/restricted_current.txt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/UserspaceTracing.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/MetricCaptureTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/InstrumentationResults.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/MetricsContainer.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
M benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/PerfettoRule.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkState.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/InstrumentationResultsTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/MetricCapture.kt
M benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/StartupTimingMetricTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCapture.kt
M benchmark/benchmark-junit4/api/public_plus_experimental_current.txt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/Profiler.kt
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
Description
one-pager: