Dispatch FPS events from ACTION_SCROLL events (#56601)#56601
Closed
Abbondanzo wants to merge 1 commit intofacebook:mainfrom
Closed
Dispatch FPS events from ACTION_SCROLL events (#56601)#56601Abbondanzo wants to merge 1 commit intofacebook:mainfrom
Abbondanzo wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D102347043. |
Summary: `ACTION_SCROLL` events (mouse wheel, trackpad, joystick) were not participating in FPS performance logging. Touch-driven scrolls already called `enableFpsListener`/`disableFpsListener` through `handlePostTouchScrolling`, which uses a stable-frames heuristic to detect when scrolling has settled (3 consecutive frames with no position change). ACTION_SCROLL events bypassed this entirely. This adds FPS listener support to the `ACTION_SCROLL` path by calling `enableFpsListener` when a scroll event arrives, then delegating to `handlePostTouchScrolling` for lifecycle management: - **Snapping ScrollViews (`ReactScrollView`, `ReactHorizontalScrollView`):** The existing debounce runnable calls `flingAndSnap` to animate to a snap point. After the snap, `handlePostTouchScrolling` monitors the animation via the stable-frames mechanism and disables the FPS listener once settled. - **Non-snapping ScrollViews (`ReactScrollView`):** `handlePostTouchScrolling` is called directly. Its re-entry guard (`mPostTouchRunnable != null`) naturally deduplicates across rapid scroll events, while `onScrollChanged` keeps the monitor alive by setting `mActivelyScrolling`. Also nulls `mPostTouchRunnable` before reassignment in the debounce cancel path to avoid stale references. Changelog: [Android][Fixed] - Dispatch FPS performance events for mouse wheel and trackpad scroll interactions in ScrollView Differential Revision: D102347043
01ace75 to
b5a82e6
Compare
|
This pull request has been merged in e0a453c. |
Collaborator
|
This pull request was successfully merged by @Abbondanzo in e0a453c When will my fix make it into a release? | How to file a pick request? |
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.
Summary:
ACTION_SCROLLevents (mouse wheel, trackpad, joystick) were not participating in FPS performance logging. Touch-driven scrolls already calledenableFpsListener/disableFpsListenerthroughhandlePostTouchScrolling, which uses a stable-frames heuristic to detect when scrolling has settled (3 consecutive frames with no position change). ACTION_SCROLL events bypassed this entirely.This adds FPS listener support to the
ACTION_SCROLLpath by callingenableFpsListenerwhen a scroll event arrives, then delegating tohandlePostTouchScrollingfor lifecycle management:ReactScrollView,ReactHorizontalScrollView): The existing debounce runnable callsflingAndSnapto animate to a snap point. After the snap,handlePostTouchScrollingmonitors the animation via the stable-frames mechanism and disables the FPS listener once settled.ReactScrollView):handlePostTouchScrollingis called directly. Its re-entry guard (mPostTouchRunnable != null) naturally deduplicates across rapid scroll events, whileonScrollChangedkeeps the monitor alive by settingmActivelyScrolling.Also nulls
mPostTouchRunnablebefore reassignment in the debounce cancel path to avoid stale references.Changelog:
[Android][Fixed] - Dispatch FPS performance events for mouse wheel and trackpad scroll interactions in ScrollView
Differential Revision: D102347043