SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

Add dynamic sampling to frame screenshots (#56135)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56135

Ports the dynamic sampling algorithm from Android (D95987488) to iOS. Uses an `encodingInProgress` atomic flag with a single encoding thread and `lastFrameData` buffer to skip screenshot encoding when the encoder is busy, while always emitting frame timing events. This prevents truncated trace data on slower devices and reduces recording overhead.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D97131485

fbshipit-source-id: 5c30f1052d5b5a61f27f2ab90946ef47b8b6b279
A
Alex Hunt committed
e0d1e29d266ff12d013af18873d9947665265433
Parent: b7aa390
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 3/19/2026, 11:57:29 AM