Commit 1156cfe
authored
Initially I tried using `entries` instead of a `values` iterator, but that was surprisingly slow. This appears to be a good middle ground (see history of this comment for old results).
Hashing is about the same, but much faster for maps which don't have O(1) lookup. Equality is much faster.
## Benchmarks before:
DeepCollectionQualityUnordered.equals(RunTime): 7427.29020979021 us.
DeepCollectionQualityUnordered.hash(RunTime): 217.8173707406213 us.
DeepCollectionQuality.equals(RunTime): 2653.23875 us.
DeepCollectionQuality.hash(RunTime): 178.1674653887114 us.
## Benchmarks after:
DeepCollectionQualityUnordered.equals(RunTime): 4435.374 us.
DeepCollectionQualityUnordered.hash(RunTime): 212.8631545473818 us.
DeepCollectionQuality.equals(RunTime): 1989.1746626686656 us.
DeepCollectionQuality.hash(RunTime): 178.3396697902722 us.
1 parent 9ab5a18 commit 1156cfe
2 files changed
+21
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
328 | 329 | | |
329 | | - | |
330 | | - | |
331 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
332 | 333 | | |
| 334 | + | |
333 | 335 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
338 | 341 | | |
339 | 342 | | |
340 | 343 | | |
| |||
343 | 346 | | |
344 | 347 | | |
345 | 348 | | |
| 349 | + | |
346 | 350 | | |
| 351 | + | |
347 | 352 | | |
348 | | - | |
| 353 | + | |
349 | 354 | | |
350 | 355 | | |
351 | 356 | | |
| |||
489 | 494 | | |
490 | 495 | | |
491 | 496 | | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
0 commit comments