Repository navigation
perf(swipeable): mount the action rails only when a side is needed - #40
Merged
Merged
Conversation
Owner
Author
|
Verification on 856cdbe:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A closed
Swipeablerow mounted two empty action rails next to its content, so every recycled row cost three native views. Nowsrc/Swipeable.tsxmounts the rails as a pair only when a side is needed and renders the native view directly. Both native views treat one child as content only and three as rails plus content.Review focus: a lone child gets the content role only after Fabric's mount batch, because the first child of a three-child mount is the left rail.
Xiaomi Mi 11 Lite (Android 13, 90 Hz), README list benchmark, Release, one session. The first launch after each install is excluded, so each row averages 2 runs:
mainSwipeableThis PR is within noise of plain rows.
mainalso measured higher here than in #37 (84.3), so this session cannot separate it from this PR. The JS cost per recycled row does separate them: in a react-test-renderer microbenchmark (2,000 recycles, 3 rounds) it drops from 73-85 µs to 40-43 µs, against 31-34 µs for a plainView. Pixel 8 Pro: 113.9 vs 113.1 for plain rows, at the 120 Hz ceiling.🤖 Generated with Claude Code