Repository navigation
[Repro #60227] RNTester Playground: ScrollView clipping pass runs after every mounting transaction - #60229
[Repro #60227] RNTester Playground: ScrollView clipping pass runs after every mounting transaction#60229beqramo wants to merge 1 commit into
Conversation
… on every mounting transaction Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi @beqramo! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary:
Reproducer for #60227, as the bot asks:
RNTesterPlayground.jsedited to show the bug. Not meant to be merged.On iOS (Fabric),
-[RCTScrollViewComponentView mountingTransactionDidMount:withSurfaceTelemetry:]calls_remountChildrenafter every mounting transaction._remountChildrenwalks the whole content of the ScrollView withupdateClippedSubviewsWithClipRect:relativeToView:, oneconvertRect:toView:per view, even when no view setsremoveClippedSubviews. Then the walk cannot change anything, but it still costs main-thread time on every transaction.The Playground renders a ScrollView with about 4k plain views (no
removeClippedSubviews) and a small view above it that updates on every frame (requestAnimationFrame+ state). So every frame has one mounting transaction, and every frame walks the 4k views. Tap the text to stop the per-frame updates and compare.How to see it: run RNTester in Release on iOS, open the Playground, and record the main thread with Instruments (Time Profiler) or
sample <pid>.-[UIView(ComponentViewProtocol) updateClippedSubviewsWithClipRect:relativeToView:]and-[CALayer convertRect:toLayer:]show undermountingTransactionDidMount:withSurfaceTelemetry:.A proposed fix is in #60230.
Changelog:
[INTERNAL] [CHANGED] - RNTester Playground repro for #60227 (not for merge)
Test Plan:
prettier@3.10.0 --checkwith the repo config on the edited file: passes.Nestedcomponent with depth 11 inside aScrollView, noremoveClippedSubviews) on RN 0.88.1 built from source, Release, iOS 26.5 simulator. There the per-frame update came from a ReanimateduseAnimatedStyle(opacity), which commits throughShadowTree::commiton the UI thread, instead of therequestAnimationFrame+ state update used here.sample <pid>for 10 s:-[RCTMountingManager performTransaction:]: 908-[RCTScrollViewComponentView mountingTransactionDidMount:withSurfaceTelemetry:]: 812, all inupdateClippedSubviewsWithClipRect:relativeToView:(305 in-[CALayer convertRect:toLayer:])🤖 Generated with Claude Code