-
Notifications
You must be signed in to change notification settings - Fork 35
Benchmarks 3.0.0
Antão Almada edited this page Apr 10, 2019
·
2 revisions
BenchmarkDotNet=v0.11.4, OS=macOS Mojave 10.14.4 (18E226) [Darwin 18.5.0]
Intel Core i5-7360U CPU 2.30GHz (Kaby Lake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=2.1.403
[Host] : .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT
DefaultJob : .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT
The benchmarks use the following collections and here's why they were selected:
-
Range - a collection that implements
IValueReadOnlyList<T>
. -
Queue - a collection that implements
IReadOnlyCollection<T>
. -
Array - a collection that implements
IReadOnlyList<T>
and returning references to items. -
List - a collection that implements
IReadOnlyList<T>
. -
Enumerable_Reference - A collection that implements
IEnumerable<T>
and returns a reference-type enumerator, generated usingyield
. -
Enumerable_Value - A collection that implements
IEnumerable<T>
and returns a value-type enumerator.
Method | Categories | Count | Mean | Error | StdDev | Ratio | RatioSD | Gen 0/1k Op | Gen 1/1k Op | Gen 2/1k Op | Allocated Memory/Op |
---|---|---|---|---|---|---|---|---|---|---|---|
Linq_Range | Range | 0 | 9.093 ns | 0.0429 ns | 0.0335 ns | 1.00 | 0.00 | - | - | - | - |
Hyperlinq_Range_ForEach | Range | 0 | 13.791 ns | 0.0719 ns | 0.0638 ns | 1.52 | 0.01 | - | - | - | - |
Hyperlinq_Range_For | Range | 0 | 7.300 ns | 0.0145 ns | 0.0129 ns | 0.80 | 0.00 | - | - | - | - |
Linq_Repeat | Repeat | 0 | 9.692 ns | 0.1359 ns | 0.1204 ns | 1.00 | 0.00 | - | - | - | - |
Hyperlinq_Repeat_ForEach | Repeat | 0 | 13.752 ns | 0.2628 ns | 0.2458 ns | 1.42 | 0.03 | - | - | - | - |
Hyperlinq_Repeat_For | Repeat | 0 | 7.006 ns | 0.0120 ns | 0.0100 ns | 0.72 | 0.01 | - | - | - | - |
Ix_Repeat | RepeatInfinitely | 0 | 15.253 ns | 0.0679 ns | 0.0567 ns | 1.00 | 0.00 | 0.0190 | - | - | 40 B |
Ix_Create | Create | 0 | 30.620 ns | 0.6191 ns | 0.5791 ns | 1.00 | 0.00 | 0.0533 | - | - | 112 B |
Linq_Range | Range | 100 | 494.532 ns | 0.9484 ns | 0.8407 ns | 1.00 | 0.00 | 0.0181 | - | - | 40 B |
Hyperlinq_Range_ForEach | Range | 100 | 186.358 ns | 0.7421 ns | 0.6197 ns | 0.38 | 0.00 | - | - | - | - |
Hyperlinq_Range_For | Range | 100 | 70.506 ns | 1.0854 ns | 0.9621 ns | 0.14 | 0.00 | - | - | - | - |
Linq_Repeat | Repeat | 100 | 512.208 ns | 1.9198 ns | 1.6031 ns | 1.00 | 0.00 | 0.0143 | - | - | 32 B |
Hyperlinq_Repeat_ForEach | Repeat | 100 | 171.489 ns | 0.5264 ns | 0.4396 ns | 0.33 | 0.00 | - | - | - | - |
Hyperlinq_Repeat_For | Repeat | 100 | 65.379 ns | 0.2653 ns | 0.2352 ns | 0.13 | 0.00 | - | - | - | - |
Ix_Repeat | RepeatInfinitely | 100 | 531.568 ns | 2.8891 ns | 2.5611 ns | 1.00 | 0.00 | 0.0181 | - | - | 40 B |
Ix_Create | Create | 100 | 694.367 ns | 6.6028 ns | 5.8532 ns | 1.00 | 0.00 | 0.0525 | - | - | 112 B |
Linq_Range | Range | 10000 | 45,488.544 ns | 762.1074 ns | 675.5884 ns | 1.00 | 0.00 | - | - | - | 40 B |
Hyperlinq_Range_ForEach | Range | 10000 | 16,217.850 ns | 60.0939 ns | 53.2717 ns | 0.36 | 0.01 | - | - | - | - |
Hyperlinq_Range_For | Range | 10000 | 5,723.897 ns | 118.1744 ns | 110.5404 ns | 0.13 | 0.00 | - | - | - | - |
Linq_Repeat | Repeat | 10000 | 48,025.151 ns | 173.2701 ns | 153.5994 ns | 1.00 | 0.00 | - | - | - | 32 B |
Hyperlinq_Repeat_ForEach | Repeat | 10000 | 14,705.305 ns | 21.0304 ns | 18.6429 ns | 0.31 | 0.00 | - | - | - | - |
Hyperlinq_Repeat_For | Repeat | 10000 | 5,662.314 ns | 27.0860 ns | 24.0110 ns | 0.12 | 0.00 | - | - | - | - |
Ix_Repeat | RepeatInfinitely | 10000 | 50,830.700 ns | 307.9757 ns | 257.1736 ns | 1.00 | 0.00 | - | - | - | 40 B |
Ix_Create | Create | 10000 | 65,290.536 ns | 914.2381 ns | 763.4302 ns | 1.00 | 0.00 | - | - | - | 112 B |
Method | Categories | Mean | Error | StdDev | Median | Ratio | Gen 0/1k Op | Gen 1/1k Op | Gen 2/1k Op | Allocated Memory/Op |
---|---|---|---|---|---|---|---|---|---|---|
Linq_Empty_ForEach | Empty() | 10.2867 ns | 0.0378 ns | 0.0316 ns | 10.2758 ns | 1.000 | - | - | - | - |
Hyperlinq_Empty_ForEach | Empty() | 0.5969 ns | 0.0162 ns | 0.0136 ns | 0.5912 ns | 0.058 | - | - | - | - |
Hyperlinq_Empty_For | Empty() | 0.0011 ns | 0.0023 ns | 0.0020 ns | 0.0000 ns | 0.000 | - | - | - | - |
Linq_Empty_Count | Empty().Count() | 28.6434 ns | 0.1297 ns | 0.1150 ns | 28.6194 ns | 1.000 | - | - | - | - |
Hyperlinq_Empty_Count | Empty().Count() | 0.0006 ns | 0.0026 ns | 0.0022 ns | 0.0000 ns | 0.000 | - | - | - | - |
Linq_Empty_Select_ForEach | Empty().Select() | 46.7192 ns | 0.9373 ns | 0.9206 ns | 46.5451 ns | 1.00 | - | - | - | - |
Hyperlinq_Empty_Select_ForEach | Empty().Select() | 10.9586 ns | 0.0490 ns | 0.0383 ns | 10.9487 ns | 0.24 | - | - | - | - |
Hyperlinq_Empty_Select_For | Empty().Select() | 10.9204 ns | 0.2445 ns | 0.3179 ns | 10.8049 ns | 0.23 | - | - | - | - |
Linq_Empty_Where_ForEach | Empty().Where() | 18.9470 ns | 0.2273 ns | 0.1898 ns | 18.8772 ns | 1.00 | - | - | - | - |
Hyperlinq_Empty_Where_ForEach | Empty().Where() | 10.9656 ns | 0.0438 ns | 0.0410 ns | 10.9496 ns | 0.58 | - | - | - | - |
Linq_Empty_Where_Select_ForEach | Empty().Where().Select() | 38.1460 ns | 0.1852 ns | 0.1547 ns | 38.0857 ns | 1.00 | - | - | - | - |
Hyperlinq_Empty_Where_Select_ForEach | Empty().Where().Select() | 12.1717 ns | 0.0389 ns | 0.0345 ns | 12.1673 ns | 0.32 | - | - | - | - |
Method | Categories | Count | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen 0/1k Op | Gen 1/1k Op | Gen 2/1k Op | Allocated Memory/Op |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Linq_Range | Range | 0 | 14.3059 ns | 0.1080 ns | 0.0902 ns | 14.2980 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_Range | Range | 0 | 0.0004 ns | 0.0011 ns | 0.0009 ns | 0.0000 ns | 0.000 | 0.00 | - | - | - | - |
Linq_Queue | Queue | 0 | 19.4595 ns | 0.1188 ns | 0.1111 ns | 19.4524 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_Queue | Queue | 0 | 0.0017 ns | 0.0056 ns | 0.0050 ns | 0.0000 ns | 0.000 | 0.00 | - | - | - | - |
Linq_Array | Array | 0 | 29.1594 ns | 0.5588 ns | 0.5227 ns | 28.9983 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_Array | Array | 0 | 0.0000 ns | 0.0000 ns | 0.0000 ns | 0.0000 ns | 0.000 | 0.00 | - | - | - | - |
Linq_List | List | 0 | 5.5251 ns | 0.0290 ns | 0.0242 ns | 5.5212 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_List | List | 0 | 0.0081 ns | 0.0062 ns | 0.0048 ns | 0.0063 ns | 0.001 | 0.00 | - | - | - | - |
Linq_Enumerable_Reference | Enumerable_Reference | 0 | 37.3877 ns | 0.3212 ns | 0.2682 ns | 37.2651 ns | 1.00 | 0.00 | 0.0190 | - | - | 40 B |
Hyperlinq_Enumerable_Reference | Enumerable_Reference | 0 | 158.2494 ns | 0.7712 ns | 0.6837 ns | 158.1483 ns | 4.23 | 0.04 | 0.0188 | - | - | 40 B |
Linq_Enumerable_Value | Enumerable_Value | 0 | 32.3962 ns | 0.1225 ns | 0.1146 ns | 32.3415 ns | 1.00 | 0.00 | 0.0228 | - | - | 48 B |
Hyperlinq_Enumerable_Value | Enumerable_Value | 0 | 7.1238 ns | 0.0497 ns | 0.0441 ns | 7.1049 ns | 0.22 | 0.00 | 0.0114 | - | - | 24 B |
Linq_Range | Range | 100 | 18.4290 ns | 0.2663 ns | 0.2361 ns | 18.3818 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_Range | Range | 100 | 0.0003 ns | 0.0014 ns | 0.0011 ns | 0.0000 ns | 0.000 | 0.00 | - | - | - | - |
Linq_Queue | Queue | 100 | 17.8994 ns | 0.0940 ns | 0.0833 ns | 17.8719 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_Queue | Queue | 100 | 0.0000 ns | 0.0000 ns | 0.0000 ns | 0.0000 ns | 0.000 | 0.00 | - | - | - | - |
Linq_Array | Array | 100 | 28.3452 ns | 0.2439 ns | 0.2036 ns | 28.3046 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_Array | Array | 100 | 0.0000 ns | 0.0000 ns | 0.0000 ns | 0.0000 ns | 0.000 | 0.00 | - | - | - | - |
Linq_List | List | 100 | 5.5075 ns | 0.0739 ns | 0.0655 ns | 5.4845 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_List | List | 100 | 0.0014 ns | 0.0041 ns | 0.0037 ns | 0.0000 ns | 0.000 | 0.00 | - | - | - | - |
Linq_Enumerable_Reference | Enumerable_Reference | 100 | 359.8963 ns | 1.3899 ns | 1.3002 ns | 359.7246 ns | 1.00 | 0.00 | 0.0186 | - | - | 40 B |
Hyperlinq_Enumerable_Reference | Enumerable_Reference | 100 | 480.8203 ns | 3.4251 ns | 3.0362 ns | 481.4116 ns | 1.34 | 0.01 | 0.0181 | - | - | 40 B |
Linq_Enumerable_Value | Enumerable_Value | 100 | 414.5251 ns | 1.4930 ns | 1.3235 ns | 414.0983 ns | 1.00 | 0.00 | 0.0224 | - | - | 48 B |
Hyperlinq_Enumerable_Value | Enumerable_Value | 100 | 69.1190 ns | 0.7772 ns | 0.7270 ns | 68.7679 ns | 0.17 | 0.00 | 0.0113 | - | - | 24 B |
Linq_Range | Range | 10000 | 18.2686 ns | 0.1079 ns | 0.0957 ns | 18.2476 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_Range | Range | 10000 | 0.0039 ns | 0.0059 ns | 0.0052 ns | 0.0008 ns | 0.000 | 0.00 | - | - | - | - |
Linq_Queue | Queue | 10000 | 17.8860 ns | 0.0638 ns | 0.0565 ns | 17.8730 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_Queue | Queue | 10000 | 0.0000 ns | 0.0000 ns | 0.0000 ns | 0.0000 ns | 0.000 | 0.00 | - | - | - | - |
Linq_Array | Array | 10000 | 28.3372 ns | 0.2704 ns | 0.2530 ns | 28.2511 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_Array | Array | 10000 | 0.0000 ns | 0.0000 ns | 0.0000 ns | 0.0000 ns | 0.000 | 0.00 | - | - | - | - |
Linq_List | List | 10000 | 5.5017 ns | 0.0404 ns | 0.0378 ns | 5.5006 ns | 1.000 | 0.00 | - | - | - | - |
Hyperlinq_List | List | 10000 | 0.0080 ns | 0.0140 ns | 0.0131 ns | 0.0000 ns | 0.001 | 0.00 | - | - | - | - |
Linq_Enumerable_Reference | Enumerable_Reference | 10000 | 31,259.1963 ns | 190.1013 ns | 168.5198 ns | 31,171.7067 ns | 1.00 | 0.00 | - | - | - | 40 B |
Hyperlinq_Enumerable_Reference | Enumerable_Reference | 10000 | 30,636.9612 ns | 315.9864 ns | 263.8630 ns | 30,676.9870 ns | 0.98 | 0.01 | - | - | - | 40 B |
Linq_Enumerable_Value | Enumerable_Value | 10000 | 35,564.8333 ns | 171.3315 ns | 160.2635 ns | 35,584.9740 ns | 1.00 | 0.00 | - | - | - | 48 B |
Hyperlinq_Enumerable_Value | Enumerable_Value | 10000 | 5,667.2384 ns | 22.9526 ns | 20.3469 ns | 5,658.4446 ns | 0.16 | 0.00 | 0.0076 | - | - | 24 B |
Method | Categories | Count | Mean | Error | StdDev | Ratio | RatioSD | Gen 0/1k Op | Gen 1/1k Op | Gen 2/1k Op | Allocated Memory/Op |
---|---|---|---|---|---|---|---|---|---|---|---|
Linq_Range | Range | 0 | 8.029 ns | 0.0153 ns | 0.0128 ns | 1.00 | 0.00 | - | - | - | - |
Hyperlinq_Range | Range | 0 | 7.062 ns | 0.0832 ns | 0.0738 ns | 0.88 | 0.01 | - | - | - | - |
Linq_Queue | Queue | 0 | 19.448 ns | 0.5092 ns | 0.4514 ns | 1.00 | 0.00 | 0.0190 | - | - | 40 B |
Hyperlinq_Queue | Queue | 0 | 12.348 ns | 0.1166 ns | 0.1034 ns | 0.64 | 0.01 | - | - | - | - |
Linq_Array | Array | 0 | 10.791 ns | 0.3054 ns | 0.2856 ns | 1.00 | 0.00 | - | - | - | - |
LinqFaster_Array | Array | 0 | 3.259 ns | 0.0110 ns | 0.0097 ns | 0.30 | 0.01 | - | - | - | - |
Hyperlinq_Array | Array | 0 | 3.477 ns | 0.0174 ns | 0.0154 ns | 0.32 | 0.01 | - | - | - | - |
Linq_List | List | 0 | 19.412 ns | 0.1342 ns | 0.1190 ns | 1.00 | 0.00 | 0.0190 | - | - | 40 B |
LinqFaster_List | List | 0 | 3.471 ns | 0.0381 ns | 0.0318 ns | 0.18 | 0.00 | - | - | - | - |
Hyperlinq_List | List | 0 | 3.264 ns | 0.0178 ns | 0.0148 ns | 0.17 | 0.00 | - | - | - | - |
Linq_Enumerable_Reference | Enumerable_Reference | 0 | 17.367 ns | 0.3327 ns | 0.3112 ns | 1.00 | 0.00 | 0.0190 | - | - | 40 B |
Hyperlinq_Enumerable_Reference | Enumerable_Reference | 0 | 246.125 ns | 3.5069 ns | 3.1088 ns | 14.16 | 0.36 | 0.0186 | - | - | 40 B |
Linq_Enumerable_Value | Enumerable_Value | 0 | 20.688 ns | 0.0805 ns | 0.0753 ns | 1.00 | 0.00 | 0.0229 | - | - | 48 B |
Hyperlinq_Enumerable_Value | Enumerable_Value | 0 | 9.049 ns | 0.0257 ns | 0.0228 ns | 0.44 | 0.00 | 0.0114 | - | - | 24 B |
Linq_Range | Range | 100 | 647.183 ns | 4.0258 ns | 3.3618 ns | 1.00 | 0.00 | 0.0181 | - | - | 40 B |
Hyperlinq_Range | Range | 100 | 232.057 ns | 1.3587 ns | 1.0608 ns | 0.36 | 0.00 | - | - | - | - |
Linq_Queue | Queue | 100 | 905.978 ns | 4.3774 ns | 3.8804 ns | 1.00 | 0.00 | 0.0181 | - | - | 40 B |
Hyperlinq_Queue | Queue | 100 | 560.334 ns | 2.3823 ns | 2.1119 ns | 0.62 | 0.00 | 0.0181 | - | - | 40 B |
Linq_Array | Array | 100 | 628.400 ns | 13.1955 ns | 12.3431 ns | 1.00 | 0.00 | 0.0143 | - | - | 32 B |
LinqFaster_Array | Array | 100 | 213.706 ns | 4.1537 ns | 4.4444 ns | 0.34 | 0.01 | - | - | - | - |
Hyperlinq_Array | Array | 100 | 183.191 ns | 8.2577 ns | 8.4801 ns | 0.29 | 0.01 | - | - | - | - |
Linq_List | List | 100 | 817.397 ns | 9.5287 ns | 8.4469 ns | 1.00 | 0.00 | 0.0181 | - | - | 40 B |
LinqFaster_List | List | 100 | 208.597 ns | 1.7166 ns | 1.6057 ns | 0.26 | 0.00 | - | - | - | - |
Hyperlinq_List | List | 100 | 207.356 ns | 0.9746 ns | 0.7609 ns | 0.25 | 0.00 | - | - | - | - |
Linq_Enumerable_Reference | Enumerable_Reference | 100 | 680.101 ns | 3.0077 ns | 2.6663 ns | 1.00 | 0.00 | 0.0181 | - | - | 40 B |
Hyperlinq_Enumerable_Reference | Enumerable_Reference | 100 | 951.951 ns | 7.7392 ns | 6.8606 ns | 1.40 | 0.01 | 0.0181 | - | - | 40 B |
Linq_Enumerable_Value | Enumerable_Value | 100 | 735.143 ns | 2.4797 ns | 2.1982 ns | 1.00 | 0.00 | 0.0219 | - | - | 48 B |
Hyperlinq_Enumerable_Value | Enumerable_Value | 100 | 219.999 ns | 3.6897 ns | 3.2708 ns | 0.30 | 0.00 | 0.0112 | - | - | 24 B |
Linq_Range | Range | 10000 | 61,888.032 ns | 1,229.6793 ns | 1,262.7901 ns | 1.00 | 0.00 | - | - | - | 40 B |
Hyperlinq_Range | Range | 10000 | 19,660.421 ns | 121.3714 ns | 107.5926 ns | 0.32 | 0.01 | - | - | - | - |
Linq_Queue | Queue | 10000 | 90,132.671 ns | 1,599.1191 ns | 1,417.5774 ns | 1.00 | 0.00 | - | - | - | 40 B |
Hyperlinq_Queue | Queue | 10000 | 54,265.937 ns | 409.0137 ns | 382.5917 ns | 0.60 | 0.01 | - | - | - | 40 B |
Linq_Array | Array | 10000 | 62,211.175 ns | 1,186.2652 ns | 1,165.0711 ns | 1.00 | 0.00 | - | - | - | 32 B |
LinqFaster_Array | Array | 10000 | 19,976.862 ns | 304.6441 ns | 284.9642 ns | 0.32 | 0.01 | - | - | - | - |
Hyperlinq_Array | Array | 10000 | 17,147.648 ns | 207.5053 ns | 194.1006 ns | 0.28 | 0.01 | - | - | - | - |
Linq_List | List | 10000 | 79,369.657 ns | 1,470.3340 ns | 1,375.3513 ns | 1.00 | 0.00 | - | - | - | 40 B |
LinqFaster_List | List | 10000 | 19,862.302 ns | 89.9659 ns | 75.1256 ns | 0.25 | 0.00 | - | - | - | - |
Hyperlinq_List | List | 10000 | 19,842.706 ns | 172.3027 ns | 134.5226 ns | 0.25 | 0.00 | - | - | - | - |
Linq_Enumerable_Reference | Enumerable_Reference | 10000 | 66,631.498 ns | 1,329.4414 ns | 2,069.7801 ns | 1.00 | 0.00 | - | - | - | 40 B |
Hyperlinq_Enumerable_Reference | Enumerable_Reference | 10000 | 70,418.250 ns | 702.8356 ns | 623.0455 ns | 1.04 | 0.04 | - | - | - | 40 B |
Linq_Enumerable_Value | Enumerable_Value | 10000 | 71,098.044 ns | 1,127.8673 ns | 999.8250 ns | 1.00 | 0.00 | - | - | - | 48 B |
Hyperlinq_Enumerable_Value | Enumerable_Value | 10000 | 19,828.080 ns | 114.7792 ns | 101.7487 ns | 0.28 | 0.00 | - | - | - | 24 B |