Repository navigation
Commit 93e5359
perf(signals): copy folded filters by exact concat while short, chain only past 8 keys
A chain from the first fold cut allocation by a quarter at depth 7 and
build time by a third under TurboFan, but the walk per key of every leaf
cost the bytecode tiers more than the copies had: CodSpeed read the
tier-1 polymorphic-chain SSR bench 10% worse, and omit-static reads paid
an extra call layer for a case with no chain at all.
Two lists now combine with concat — one builtin call, exact-size (the
slice() + push it replaces grew the backing store to 1.5n + 16 slots) —
while the result is within 8 keys; past that, or with a predicate on
either side, they chain as before. The tier-1 bench's four omits hide
1 + 1 + 2 + 1 keys, so every leaf on that shape stays one flat list and a
check is one includes; a deep leaf on a longer chain is one short list
plus a few links. isHidden is the walk itself (no second call layer), and
combineHidden tells a list, a predicate and a link apart by typeof and
constructor rather than Array.isArray / instanceof, which are builtin
calls in the bytecode tiers.
Tier-1 polymorphic-chain SSR bench (Kobalte shape, renderToString, 200
rows), the harness driven in-process under each tier, min of 5 vs next:
interpreter -7%, Sparkplug -12%, TurboFan -17%; the compiled control is
flat. Depth-7 props chain: TurboFan build -14%, build + consume -9%;
interpreter and Sparkplug +3-5%. A limit of 12 was measured and is worse
in every tier (more copies, less chain).
Co-authored-by: Claude via Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>1 parent fbc2ae2 commit 93e5359
3 files changed
Lines changed: 72 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
| |||
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
150 | 155 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
156 | 171 | | |
157 | 172 | | |
158 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
827 | | - | |
828 | | - | |
829 | | - | |
| 827 | + | |
| 828 | + | |
830 | 829 | | |
831 | 830 | | |
832 | 831 | | |
| |||
835 | 834 | | |
836 | 835 | | |
837 | 836 | | |
838 | | - | |
| 837 | + | |
839 | 838 | | |
840 | 839 | | |
841 | | - | |
| 840 | + | |
842 | 841 | | |
843 | | - | |
| 842 | + | |
844 | 843 | | |
845 | | - | |
| 844 | + | |
846 | 845 | | |
847 | 846 | | |
848 | 847 | | |
849 | 848 | | |
850 | 849 | | |
851 | 850 | | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
852 | 874 | | |
853 | 875 | | |
854 | 876 | | |
| |||
0 commit comments