Commit 4e6493a
committed
Make class prop resolution faster (#28766)
`delete` causes an object (in V8, and maybe other engines) to deopt to a
dictionary instead of a class. Instead of `assign` + `delete`, manually
iterate over all the properties, like the JSX runtime does.
To avoid copying the object twice I moved the `ref` prop removal to come
before handling default props. If we already cloned the props to remove
`ref`, then we can skip cloning again to handle default props.
DiffTrain build for commit bfd8da8.1 parent 6eddd13 commit 4e6493a
File tree
10 files changed
+58
-46
lines changed- compiled-rn/facebook-fbsource/xplat/js
- RKJSModules/vendor/react-test-renderer/cjs
- react-native-github/Libraries/Renderer
- implementations
10 files changed
+58
-46
lines changedLines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
12999 | 12999 | | |
13000 | 13000 | | |
13001 | 13001 | | |
13002 | | - | |
| 13002 | + | |
13003 | 13003 | | |
13004 | 13004 | | |
13005 | 13005 | | |
| |||
13008 | 13008 | | |
13009 | 13009 | | |
13010 | 13010 | | |
13011 | | - | |
| 13011 | + | |
| 13012 | + | |
| 13013 | + | |
| 13014 | + | |
| 13015 | + | |
13012 | 13016 | | |
13013 | | - | |
13014 | | - | |
13015 | | - | |
| 13017 | + | |
| 13018 | + | |
| 13019 | + | |
13016 | 13020 | | |
13017 | 13021 | | |
13018 | 13022 | | |
| |||
26620 | 26624 | | |
26621 | 26625 | | |
26622 | 26626 | | |
26623 | | - | |
| 26627 | + | |
26624 | 26628 | | |
26625 | 26629 | | |
26626 | 26630 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
3472 | 3472 | | |
3473 | 3473 | | |
3474 | 3474 | | |
3475 | | - | |
| 3475 | + | |
3476 | 3476 | | |
3477 | 3477 | | |
3478 | 3478 | | |
| |||
9154 | 9154 | | |
9155 | 9155 | | |
9156 | 9156 | | |
9157 | | - | |
| 9157 | + | |
9158 | 9158 | | |
9159 | 9159 | | |
9160 | 9160 | | |
| |||
9185 | 9185 | | |
9186 | 9186 | | |
9187 | 9187 | | |
9188 | | - | |
| 9188 | + | |
9189 | 9189 | | |
9190 | 9190 | | |
9191 | 9191 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
3630 | 3630 | | |
3631 | 3631 | | |
3632 | 3632 | | |
3633 | | - | |
| 3633 | + | |
3634 | 3634 | | |
3635 | 3635 | | |
3636 | 3636 | | |
| |||
9770 | 9770 | | |
9771 | 9771 | | |
9772 | 9772 | | |
9773 | | - | |
| 9773 | + | |
9774 | 9774 | | |
9775 | 9775 | | |
9776 | 9776 | | |
| |||
9814 | 9814 | | |
9815 | 9815 | | |
9816 | 9816 | | |
9817 | | - | |
| 9817 | + | |
9818 | 9818 | | |
9819 | 9819 | | |
9820 | 9820 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
16552 | 16552 | | |
16553 | 16553 | | |
16554 | 16554 | | |
16555 | | - | |
| 16555 | + | |
16556 | 16556 | | |
16557 | 16557 | | |
16558 | 16558 | | |
| |||
16561 | 16561 | | |
16562 | 16562 | | |
16563 | 16563 | | |
16564 | | - | |
| 16564 | + | |
| 16565 | + | |
| 16566 | + | |
| 16567 | + | |
| 16568 | + | |
16565 | 16569 | | |
16566 | | - | |
16567 | | - | |
16568 | | - | |
| 16570 | + | |
| 16571 | + | |
| 16572 | + | |
16569 | 16573 | | |
16570 | 16574 | | |
16571 | 16575 | | |
| |||
30314 | 30318 | | |
30315 | 30319 | | |
30316 | 30320 | | |
30317 | | - | |
| 30321 | + | |
30318 | 30322 | | |
30319 | 30323 | | |
30320 | 30324 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
5018 | 5018 | | |
5019 | 5019 | | |
5020 | 5020 | | |
5021 | | - | |
| 5021 | + | |
5022 | 5022 | | |
5023 | 5023 | | |
5024 | 5024 | | |
| |||
10584 | 10584 | | |
10585 | 10585 | | |
10586 | 10586 | | |
10587 | | - | |
| 10587 | + | |
10588 | 10588 | | |
10589 | 10589 | | |
10590 | 10590 | | |
| |||
10627 | 10627 | | |
10628 | 10628 | | |
10629 | 10629 | | |
10630 | | - | |
| 10630 | + | |
10631 | 10631 | | |
10632 | 10632 | | |
10633 | 10633 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
5210 | 5210 | | |
5211 | 5211 | | |
5212 | 5212 | | |
5213 | | - | |
| 5213 | + | |
5214 | 5214 | | |
5215 | 5215 | | |
5216 | 5216 | | |
| |||
11289 | 11289 | | |
11290 | 11290 | | |
11291 | 11291 | | |
11292 | | - | |
| 11292 | + | |
11293 | 11293 | | |
11294 | 11294 | | |
11295 | 11295 | | |
| |||
11345 | 11345 | | |
11346 | 11346 | | |
11347 | 11347 | | |
11348 | | - | |
| 11348 | + | |
11349 | 11349 | | |
11350 | 11350 | | |
11351 | 11351 | | |
| |||
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
16823 | 16823 | | |
16824 | 16824 | | |
16825 | 16825 | | |
16826 | | - | |
| 16826 | + | |
16827 | 16827 | | |
16828 | 16828 | | |
16829 | 16829 | | |
| |||
16832 | 16832 | | |
16833 | 16833 | | |
16834 | 16834 | | |
16835 | | - | |
| 16835 | + | |
| 16836 | + | |
| 16837 | + | |
| 16838 | + | |
| 16839 | + | |
16836 | 16840 | | |
16837 | | - | |
16838 | | - | |
16839 | | - | |
| 16841 | + | |
| 16842 | + | |
| 16843 | + | |
16840 | 16844 | | |
16841 | 16845 | | |
16842 | 16846 | | |
| |||
30754 | 30758 | | |
30755 | 30759 | | |
30756 | 30760 | | |
30757 | | - | |
| 30761 | + | |
30758 | 30762 | | |
30759 | 30763 | | |
30760 | 30764 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
5083 | 5083 | | |
5084 | 5084 | | |
5085 | 5085 | | |
5086 | | - | |
| 5086 | + | |
5087 | 5087 | | |
5088 | 5088 | | |
5089 | 5089 | | |
| |||
10800 | 10800 | | |
10801 | 10801 | | |
10802 | 10802 | | |
10803 | | - | |
| 10803 | + | |
10804 | 10804 | | |
10805 | 10805 | | |
10806 | 10806 | | |
| |||
10843 | 10843 | | |
10844 | 10844 | | |
10845 | 10845 | | |
10846 | | - | |
| 10846 | + | |
10847 | 10847 | | |
10848 | 10848 | | |
10849 | 10849 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
5275 | 5275 | | |
5276 | 5276 | | |
5277 | 5277 | | |
5278 | | - | |
| 5278 | + | |
5279 | 5279 | | |
5280 | 5280 | | |
5281 | 5281 | | |
| |||
11506 | 11506 | | |
11507 | 11507 | | |
11508 | 11508 | | |
11509 | | - | |
| 11509 | + | |
11510 | 11510 | | |
11511 | 11511 | | |
11512 | 11512 | | |
| |||
11562 | 11562 | | |
11563 | 11563 | | |
11564 | 11564 | | |
11565 | | - | |
| 11565 | + | |
11566 | 11566 | | |
11567 | 11567 | | |
11568 | 11568 | | |
| |||
0 commit comments