Add idle frame support to Performance timeline (#57952) - #57952
Closed
huntie wants to merge 1 commit into
Closed
Conversation
Summary:
Implement Idle frame spans in React Native DevTools, by emitting synthetic `NeedsBeginFrameChanged` + `BeginFrame` events.
**Definition**
An idle frame is emitted whenever the gap between two consecutive frames exceeds one vsync interval, derived from the display's refresh rate (`CADisplayLink.duration` on iOS, `Display.refreshRate` on Android, falling back to 60 Hz).
```
frame N gap > 1 vsync frame N+1
+------------+ +--------------------------------+ +------------+
| BeginFrame | | NeedsBeginFrameChanged | | BeginFrame |
| DrawFrame | | BeginFrame (no DrawFrame) | | DrawFrame |
+------------+ +--------------------------------+ +------------+
rendered as an "Idle frame"
```
**Implementation notes**
- Drop frames that begin before the recording start — Android `FrameMetrics` can deliver frames from app startup, and the first iOS `CADisplayLink` callback reports the previous vsync.
- Sort frames by begin timestamp before serializing, since async screenshot encoding can deliver them out of order and break gap detection.
- iOS: skip the frame event when the screenshot is unchanged, letting the gap render as an idle frame.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D97502569
huntie
force-pushed
the
export-D97502569
branch
from
August 14, 2026 11:51
08bb95f to
e1f2673
Compare
|
This pull request has been merged in b74adf0. |
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:
Implement Idle frame spans in React Native DevTools, by emitting synthetic
NeedsBeginFrameChanged+BeginFrameevents.Definition
An idle frame is emitted whenever the gap between two consecutive frames exceeds one vsync interval, derived from the display's refresh rate (
CADisplayLink.durationon iOS,Display.refreshRateon Android, falling back to 60 Hz).Implementation notes
FrameMetricscan deliver frames from app startup, and the first iOSCADisplayLinkcallback reports the previous vsync.Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D97502569