Commit 7488dc0
Use CopyOnWriteArrayList in MemoryPressureRouter (#43486)
Summary:
Pull Request resolved: #43486
We use `CopyOnWriteArrayList` in other places across the React Native codebase, as it assumes that reading happens more frequently than updating. This saves us from needing to synchronize and copy when we access the list of listeners.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D54806272
fbshipit-source-id: d1b54d532edb2af3391a7e4fdc758f705621227d1 parent a27e2ac commit 7488dc0
File tree
1 file changed
+8
-12
lines changed- packages/react-native/ReactAndroid/src/main/java/com/facebook/react
1 file changed
+8
-12
lines changedLines changed: 8 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
17 | 15 | | |
18 | | - | |
| 16 | + | |
19 | 17 | | |
20 | | - | |
21 | | - | |
| 18 | + | |
| 19 | + | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
| |||
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 53 | + | |
58 | 54 | | |
59 | 55 | | |
60 | 56 | | |
| |||
0 commit comments