Fixed
Status Update
Comments
cc...@google.com <cc...@google.com>
fi...@gmail.com <fi...@gmail.com>
cc...@google.com <cc...@google.com> #2
Thank you for the report! Able to reproduce this overhead in AccessibilityBenchmark
, we only didn't catch this because the tracing was added at the same time as the benchmark.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 3889210555e684de658a331803e46305122ab23f
Author: Chris Craik <ccraik@google.com>
Date: Tue Aug 27 15:26:23 2024
Speed up Accessibility and SemanticsEvent benchmarks by >6x by removing overly verbose tracing
Before:
3,153,228 ns 1070 allocs Trace Method Trace AccessibilityBenchmark.fetchAccessibilityNodeInfo
94,299,162 ns 5970 allocs Trace Method Trace SemanticsEventsBenchmark.sendSemanticsEvents
After:
499,002 ns 1070 allocs Trace Method Trace AccessibilityBenchmark.fetchAccessibilityNodeInfo
13,568,693 ns 5958 allocs Trace Method Trace SemanticsEventsBenchmark.sendSemanticsEvents
Most tracepoints were extremely trivial (single getter or allocation),
and the consistently longest tracepoints
(populateAccessibilityNodeInfoProperties, setTraversalValues,
sendAccessibilityEvent) were all significantly less than 1ms.
Measurements above on clock locked mokey.
Fixes: 362530618
Test: AccessibilityBenchmark
Test: SemanticsEventBenchmark
Relnote: "Significantly improved performance of accessibility node
info and semantics events by removing verbose tracing."
Change-Id: I891564c39879b0863a1d9543b4b44d786ebea4ba
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
https://android-review.googlesource.com/3245225
Branch: androidx-main
commit 3889210555e684de658a331803e46305122ab23f
Author: Chris Craik <ccraik@google.com>
Date: Tue Aug 27 15:26:23 2024
Speed up Accessibility and SemanticsEvent benchmarks by >6x by removing overly verbose tracing
Before:
3,153,228 ns 1070 allocs Trace Method Trace AccessibilityBenchmark.fetchAccessibilityNodeInfo
94,299,162 ns 5970 allocs Trace Method Trace SemanticsEventsBenchmark.sendSemanticsEvents
After:
499,002 ns 1070 allocs Trace Method Trace AccessibilityBenchmark.fetchAccessibilityNodeInfo
13,568,693 ns 5958 allocs Trace Method Trace SemanticsEventsBenchmark.sendSemanticsEvents
Most tracepoints were extremely trivial (single getter or allocation),
and the consistently longest tracepoints
(populateAccessibilityNodeInfoProperties, setTraversalValues,
sendAccessibilityEvent) were all significantly less than 1ms.
Measurements above on clock locked mokey.
Fixes: 362530618
Test: AccessibilityBenchmark
Test: SemanticsEventBenchmark
Relnote: "Significantly improved performance of accessibility node
info and semantics events by removing verbose tracing."
Change-Id: I891564c39879b0863a1d9543b4b44d786ebea4ba
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
na...@google.com <na...@google.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui:1.7.2
androidx.compose.ui:ui-android:1.7.2
androidx.compose.ui:ui-jvmstubs:1.7.2
androidx.compose.ui:ui-linuxx64stubs:1.7.2
Description
Jetpack Compose component(s) used: compose-ui
Android Studio Build: -
Kotlin version: 2.0.0
Steps to Reproduce or Code Sample to Reproduce:
1. Enable tracing on a compose application (I used the record_android_trace script)
2. Collect tracing while generating UI updates
3. Notice frequent collapseSemantics spans of around 5-10 us that lead to large AccessibilityLoopIteration spans
Stack trace (if applicable):