Skip to content

Improve performance of SemanticsNode.traversalOrderedChildren() and…#2900

Merged
Alexander Maryanovsky (m-sasha) merged 1 commit into
jb-mainfrom
m-sasha/traversalOrderedChildren-performance
Mar 23, 2026
Merged

Improve performance of SemanticsNode.traversalOrderedChildren() and…#2900
Alexander Maryanovsky (m-sasha) merged 1 commit into
jb-mainfrom
m-sasha/traversalOrderedChildren-performance

Conversation

@m-sasha

@m-sasha Alexander Maryanovsky (m-sasha) commented Mar 22, 2026

Copy link
Copy Markdown

Improve performance of SemanticsNode.traversalOrderedChildren() and cache its value in ComposeAccessible.

Fixes https://youtrack.jetbrains.com/issue/CMP-9962/Improve-performance-of-traversalOrderedChildren

Testing

Tested manually with

fun main() = singleWindowApplication(WindowState(size = DpSize(1800.dp, 900.dp))) {
    Box(Modifier.fillMaxSize()) {
        Column(
            modifier = Modifier
                .fillMaxHeight()
                .verticalScroll(rememberScrollState())
                .semantics {
                    isTraversalGroup = true
                }
        ) {
            repeat(50) {
                Row(Modifier.fillMaxWidth()) {
                    repeat(50) {
                        TextField(
                            state = rememberTextFieldState(initialText = "XX"),
                            lineLimits = TextFieldLineLimits.SingleLine,
                            modifier = Modifier.width(60.dp)
                        )
                    }
                }
            }
        }
    }
}

Run the app with VoiceOver off, wait for the window to display, then turn VoiceOver on.

Release Notes

Fixes - Desktop

  • [Accessibility] Improve performance of traversal groups with a large amount of children

@m-sasha Alexander Maryanovsky (m-sasha) merged commit 0a9eb66 into jb-main Mar 23, 2026
18 checks passed
@m-sasha Alexander Maryanovsky (m-sasha) deleted the m-sasha/traversalOrderedChildren-performance branch March 23, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants