ArrayWhereToList.cs
BenchmarkDotNet=v0.13.2, OS=macOS Monterey 12.3 (21E230) [Darwin 21.4.0]
Apple M1 Pro, 1 CPU, 10 logical and 10 physical cores
.NET SDK=7.0.101
[Host] : .NET 7.0.1 (7.0.122.56804), Arm64 RyuJIT AdvSIMD
DefaultJob : .NET 7.0.1 (7.0.122.56804), Arm64 RyuJIT AdvSIMD
Method |
Count |
Mean |
Error |
StdDev |
Ratio |
RatioSD |
Gen0 |
Gen1 |
Gen2 |
Allocated |
Alloc Ratio |
ForEach |
100 |
158.2 ns |
0.39 ns |
0.31 ns |
0.51 |
0.00 |
0.1032 |
- |
- |
648 B |
0.93 |
Linq |
100 |
310.1 ns |
1.98 ns |
1.66 ns |
1.00 |
0.00 |
0.1106 |
- |
- |
696 B |
1.00 |
LinqGenDelegate |
100 |
384.6 ns |
3.51 ns |
3.28 ns |
1.24 |
0.01 |
0.0429 |
- |
- |
272 B |
0.39 |
LinqGenStruct |
100 |
315.6 ns |
1.84 ns |
1.63 ns |
1.02 |
0.01 |
0.0429 |
- |
- |
272 B |
0.39 |
|
|
|
|
|
|
|
|
|
|
|
|
ForEach |
10000 |
28,224.4 ns |
296.17 ns |
277.04 ns |
0.63 |
0.01 |
10.4675 |
1.2817 |
- |
65840 B |
1.00 |
Linq |
10000 |
45,104.2 ns |
114.86 ns |
101.82 ns |
1.00 |
0.00 |
10.4370 |
1.2817 |
- |
65888 B |
1.00 |
LinqGenDelegate |
10000 |
37,314.5 ns |
571.74 ns |
534.80 ns |
0.83 |
0.01 |
3.1738 |
0.1831 |
- |
20192 B |
0.31 |
LinqGenStruct |
10000 |
15,299.1 ns |
367.57 ns |
1,036.74 ns |
0.35 |
0.02 |
3.2043 |
0.2136 |
- |
20192 B |
0.31 |
|
|
|
|
|
|
|
|
|
|
|
|
ForEach |
1000000 |
3,888,800.2 ns |
28,828.83 ns |
24,073.38 ns |
0.81 |
0.01 |
656.2500 |
636.7188 |
636.7188 |
4195164 B |
1.00 |
Linq |
1000000 |
4,799,082.1 ns |
15,458.64 ns |
13,703.68 ns |
1.00 |
0.00 |
523.4375 |
515.6250 |
507.8125 |
4195134 B |
1.00 |
LinqGenDelegate |
1000000 |
4,916,134.0 ns |
98,250.09 ns |
100,895.61 ns |
1.02 |
0.02 |
226.5625 |
226.5625 |
226.5625 |
2001089 B |
0.48 |
LinqGenStruct |
1000000 |
4,354,553.0 ns |
78,455.38 ns |
73,387.22 ns |
0.91 |
0.02 |
226.5625 |
226.5625 |
226.5625 |
2001089 B |
0.48 |