Commit 9d231af
Add pixel diffing to RCTFrameTimingsObserver (#56043)
Summary:
Pull Request resolved: #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: 76f492f0ceb6b3efea3fce822036ed6cb6067b831 parent e99f8f9 commit 9d231af
1 file changed
Lines changed: 21 additions & 0 deletions
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
130 | 151 | | |
131 | 152 | | |
132 | 153 | | |
| |||
0 commit comments