Skip to content

Commit 59d8d40

Browse files
authored
Fix Contains() and ToArray() (#376)
* Fix Contains() and ToArray() #373 * Fix Contains() with custom IEqualityComparer<>
1 parent 2a8f961 commit 59d8d40

File tree

53 files changed

+814
-298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+814
-298
lines changed

Benchmarks/ContainsBenchmarks.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,51 @@
44
[ContainsBenchmarks.cs](../NetFabric.Hyperlinq.Benchmarks/Benchmarks/ContainsBenchmarks.cs)
55

66
### References:
7-
- Linq: 6.0.0-preview.5.21301.5
7+
- Linq: 6.0.0-preview.7.21377.19
88
- System.Linq.Async: [5.0.0](https://www.nuget.org/packages/System.Linq.Async/5.0.0)
99
- System.Interactive: [5.0.0](https://www.nuget.org/packages/System.Interactive/5.0.0)
1010
- System.Interactive.Async: [5.0.0](https://www.nuget.org/packages/System.Interactive.Async/5.0.0)
11-
- StructLinq: [0.26.0](https://www.nuget.org/packages/StructLinq/0.26.0)
12-
- NetFabric.Hyperlinq: [3.0.0-beta44](https://www.nuget.org/packages/NetFabric.Hyperlinq/3.0.0-beta44)
11+
- StructLinq: [0.27.0](https://www.nuget.org/packages/StructLinq/0.27.0)
12+
- NetFabric.Hyperlinq: [3.0.0-beta45](https://www.nuget.org/packages/NetFabric.Hyperlinq/3.0.0-beta45)
1313

1414
### Results:
1515
``` ini
1616

17-
BenchmarkDotNet=v0.13.0.1555-nightly, OS=Windows 10.0.19043.1055 (21H1/May2021Update)
18-
Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), 1 CPU, 4 logical and 2 physical cores
19-
.NET SDK=6.0.100-preview.5.21302.13
20-
[Host] : .NET 6.0.0 (6.0.21.30105), X64 RyuJIT
21-
Job-UNTOJZ : .NET 6.0.0 (6.0.21.30105), X64 RyuJIT
17+
BenchmarkDotNet=v0.13.0.1561-nightly, OS=macOS Catalina 10.15.7 (19H1323) [Darwin 19.6.0]
18+
Intel Core i5-7360U CPU 2.30GHz (Kaby Lake), 1 CPU, 4 logical and 2 physical cores
19+
.NET SDK=6.0.100-preview.7.21379.14
20+
[Host] : .NET 6.0.0 (6.0.21.37719), X64 RyuJIT
21+
Job-PWZZUK : .NET 6.0.0 (6.0.21.37719), X64 RyuJIT
2222

2323
Runtime=.NET 6.0
2424

2525
```
26-
| Method | Categories | Count | Mean | Error | StdDev | Ratio | Gen 0 | Gen 1 | Gen 2 | Allocated |
27-
|------------------------------------ |-------------------------- |------ |------------:|---------:|---------:|------:|-------:|------:|------:|----------:|
28-
| Linq_Array | Array | 100 | 39.09 ns | 0.295 ns | 0.262 ns | 1.00 | - | - | - | - |
29-
| Hyperlinq_Array | Array | 100 | 30.28 ns | 0.204 ns | 0.181 ns | 0.77 | - | - | - | - |
30-
| Hyperlinq_Array_SIMD | Array | 100 | 23.08 ns | 0.070 ns | 0.066 ns | 0.59 | - | - | - | - |
31-
| | | | | | | | | | | |
32-
| Linq_Enumerable_Value | Enumerable_Value | 100 | 630.38 ns | 3.890 ns | 3.449 ns | 1.00 | 0.0153 | - | - | 32 B |
33-
| Hyperlinq_Enumerable_Value | Enumerable_Value | 100 | 213.68 ns | 2.687 ns | 2.382 ns | 0.34 | 0.0191 | - | - | 40 B |
34-
| | | | | | | | | | | |
35-
| Linq_Collection_Value | Collection_Value | 100 | 36.47 ns | 0.259 ns | 0.230 ns | 1.00 | - | - | - | - |
36-
| Hyperlinq_Collection_Value | Collection_Value | 100 | 37.04 ns | 0.240 ns | 0.200 ns | 1.02 | - | - | - | - |
37-
| | | | | | | | | | | |
38-
| Linq_List_Value | List_Value | 100 | 37.53 ns | 0.226 ns | 0.201 ns | 1.00 | - | - | - | - |
39-
| Hyperlinq_List_Value | List_Value | 100 | 40.39 ns | 0.201 ns | 0.178 ns | 1.08 | - | - | - | - |
40-
| | | | | | | | | | | |
41-
| Linq_AsyncEnumerable_Value | AsyncEnumerable_Value | 100 | 1,633.17 ns | 6.551 ns | 6.128 ns | 1.00 | 0.0153 | - | - | 32 B |
42-
| Hyperlinq_AsyncEnumerable_Value | AsyncEnumerable_Value | 100 | 948.62 ns | 2.231 ns | 1.978 ns | 0.58 | - | - | - | - |
43-
| | | | | | | | | | | |
44-
| Linq_Enumerable_Reference | Enumerable_Reference | 100 | 628.50 ns | 3.975 ns | 3.719 ns | 1.00 | 0.0153 | - | - | 32 B |
45-
| Hyperlinq_Enumerable_Reference | Enumerable_Reference | 100 | 758.41 ns | 6.989 ns | 6.537 ns | 1.21 | 0.0153 | - | - | 32 B |
46-
| | | | | | | | | | | |
47-
| Linq_Collection_Reference | Collection_Reference | 100 | 36.32 ns | 0.205 ns | 0.192 ns | 1.00 | - | - | - | - |
48-
| Hyperlinq_Collection_Reference | Collection_Reference | 100 | 35.42 ns | 0.170 ns | 0.159 ns | 0.98 | - | - | - | - |
49-
| | | | | | | | | | | |
50-
| Linq_List_Reference | List_Reference | 100 | 37.41 ns | 0.137 ns | 0.121 ns | 1.00 | - | - | - | - |
51-
| Hyperlinq_List_Reference | List_Reference | 100 | 40.65 ns | 0.173 ns | 0.154 ns | 1.09 | - | - | - | - |
52-
| | | | | | | | | | | |
53-
| Linq_AsyncEnumerable_Reference | AsyncEnumerable_Reference | 100 | 1,630.05 ns | 6.055 ns | 5.368 ns | 1.00 | 0.0153 | - | - | 32 B |
54-
| Hyperlinq_AsyncEnumerable_Reference | AsyncEnumerable_Reference | 100 | 1,749.10 ns | 5.811 ns | 4.537 ns | 1.07 | 0.0153 | - | - | 32 B |
26+
| Method | Categories | Count | Mean | Error | StdDev | Ratio | RatioSD | Gen 0 | Gen 1 | Gen 2 | Allocated |
27+
|------------------------------------ |-------------------------- |------ |------------:|----------:|----------:|-------------:|--------:|-------:|------:|------:|----------:|
28+
| Linq_Array | Array | 100 | 40.84 ns | 0.155 ns | 0.137 ns | baseline | | - | - | - | - |
29+
| Hyperlinq_Array | Array | 100 | 39.48 ns | 0.544 ns | 0.509 ns | 1.04x faster | 0.01x | - | - | - | - |
30+
| Hyperlinq_Array_SIMD | Array | 100 | 24.73 ns | 0.106 ns | 0.094 ns | 1.65x faster | 0.01x | - | - | - | - |
31+
| | | | | | | | | | | | |
32+
| Linq_Enumerable_Value | Enumerable_Value | 100 | 698.87 ns | 4.071 ns | 3.808 ns | baseline | | 0.0153 | - | - | 32 B |
33+
| Hyperlinq_Enumerable_Value | Enumerable_Value | 100 | 131.79 ns | 0.836 ns | 0.699 ns | 5.30x faster | 0.04x | - | - | - | - |
34+
| | | | | | | | | | | | |
35+
| Linq_Collection_Value | Collection_Value | 100 | 41.31 ns | 0.190 ns | 0.178 ns | baseline | | - | - | - | - |
36+
| Hyperlinq_Collection_Value | Collection_Value | 100 | 48.15 ns | 0.182 ns | 0.161 ns | 1.17x slower | 0.01x | - | - | - | - |
37+
| | | | | | | | | | | | |
38+
| Linq_List_Value | List_Value | 100 | 42.47 ns | 0.369 ns | 0.327 ns | baseline | | - | - | - | - |
39+
| Hyperlinq_List_Value | List_Value | 100 | 48.39 ns | 0.315 ns | 0.263 ns | 1.14x slower | 0.01x | - | - | - | - |
40+
| | | | | | | | | | | | |
41+
| Linq_AsyncEnumerable_Value | AsyncEnumerable_Value | 100 | 2,117.62 ns | 24.109 ns | 22.552 ns | baseline | | 0.0153 | - | - | 32 B |
42+
| Hyperlinq_AsyncEnumerable_Value | AsyncEnumerable_Value | 100 | 1,065.50 ns | 3.295 ns | 2.572 ns | 1.99x faster | 0.02x | - | - | - | - |
43+
| | | | | | | | | | | | |
44+
| Linq_Enumerable_Reference | Enumerable_Reference | 100 | 701.55 ns | 11.099 ns | 9.839 ns | baseline | | 0.0153 | - | - | 32 B |
45+
| Hyperlinq_Enumerable_Reference | Enumerable_Reference | 100 | 723.25 ns | 3.170 ns | 2.965 ns | 1.03x slower | 0.01x | 0.0153 | - | - | 32 B |
46+
| | | | | | | | | | | | |
47+
| Linq_Collection_Reference | Collection_Reference | 100 | 44.63 ns | 0.412 ns | 0.344 ns | baseline | | - | - | - | - |
48+
| Hyperlinq_Collection_Reference | Collection_Reference | 100 | 46.06 ns | 0.179 ns | 0.140 ns | 1.03x slower | 0.01x | - | - | - | - |
49+
| | | | | | | | | | | | |
50+
| Linq_List_Reference | List_Reference | 100 | 44.93 ns | 0.386 ns | 0.342 ns | baseline | | - | - | - | - |
51+
| Hyperlinq_List_Reference | List_Reference | 100 | 47.14 ns | 0.188 ns | 0.167 ns | 1.05x slower | 0.01x | - | - | - | - |
52+
| | | | | | | | | | | | |
53+
| Linq_AsyncEnumerable_Reference | AsyncEnumerable_Reference | 100 | 2,104.73 ns | 7.920 ns | 6.183 ns | baseline | | 0.0153 | - | - | 32 B |
54+
| Hyperlinq_AsyncEnumerable_Reference | AsyncEnumerable_Reference | 100 | 2,061.42 ns | 4.170 ns | 3.697 ns | 1.02x faster | 0.00x | 0.0153 | - | - | 32 B |

0 commit comments

Comments
 (0)