SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Add pixel diffing to RCTFrameTimingsObserver (#56043)

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

Use pixel hash comparison to avoid encoding duplicate screenshots on iOS, reducing overhead when frames don't change. Matches Android behaviour.

- Samples every 64th pixel with a fast FNV-1a hash (~0.1ms on main thread).
- Skips JPEG encoding and CDP transport entirely for unchanged frames — the dominant per-frame cost.

**Why this approach**

Attempted `CATransaction` completion blocks, however these fire on commits that produce no visual change. No other public API on iOS.

Changelog: [Internal]

Reviewed By: sbuggay

Differential Revision: D95981881

fbshipit-source-id: 76f492f0ceb6b3efea3fce822036ed6cb6067b83
A
Alex Hunt committed
9d231af648a9355f94b296944f36a8f52b7b08c7
Parent: e99f8f9
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 3/10/2026, 11:04:45 PM