Commit 89612b2
* feat(distinct): remove `distinctKey`, `distinct` signature change and perf improvements
- Adds a limited Set ponyfill for runtimes that do not support `Set`
- `distinct` now supports an optional keySelector argument that the user can use to select the value to check distinct on
- `distinctKey` is removed as it is redundant
- `distinct` no longer supports a comparer function argument, as there is little to no use case for such an argument that could not be covered by the keySelector
- updates tests to remove tests that do not make sense and test new functionality
BREAKING CHANGE: `distinctKey` has been removed. Use `distinct`
BREAKING CHANGE: `distinct` operator has changed, first argument is an
optional `keySelector`. The custom `compare` function is no longer
supported.
resolves #2009
* perf(distinct): increase `distinct()` perf by improving deopts
- moves keySelector call to a different function with a try catch to improve V8 optimization
- distinct calls with no keySelector passed now take a fully optimized path, doubling speed again
related #2009
* docs(distinct): update distinct docs to fit new API
1 parent d13dbb4 commit 89612b2
File tree
7 files changed
+156
-322
lines changed- spec
- operators
- util
- src
- operator
- util
7 files changed
+156
-322
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
152 | 144 | | |
153 | | - | |
| 145 | + | |
| 146 | + | |
154 | 147 | | |
155 | | - | |
| 148 | + | |
156 | 149 | | |
157 | 150 | | |
158 | 151 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 152 | + | |
170 | 153 | | |
171 | 154 | | |
172 | 155 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
176 | 159 | | |
177 | | - | |
| 160 | + | |
178 | 161 | | |
179 | 162 | | |
180 | | - | |
| 163 | + | |
181 | 164 | | |
182 | 165 | | |
183 | 166 | | |
| |||
187 | 170 | | |
188 | 171 | | |
189 | 172 | | |
190 | | - | |
191 | 173 | | |
192 | | - | |
| 174 | + | |
193 | 175 | | |
194 | 176 | | |
195 | 177 | | |
| |||
200 | 182 | | |
201 | 183 | | |
202 | 184 | | |
203 | | - | |
204 | 185 | | |
205 | | - | |
| 186 | + | |
206 | 187 | | |
207 | 188 | | |
208 | 189 | | |
| |||
214 | 195 | | |
215 | 196 | | |
216 | 197 | | |
217 | | - | |
218 | 198 | | |
219 | | - | |
| 199 | + | |
220 | 200 | | |
221 | 201 | | |
222 | 202 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
0 commit comments