Created
August 1, 2021 12:19
-
-
Save adams85/9ce7322df796fd7bdd8d663812f26065 to your computer and use it in GitHub Desktop.
Benchmark for iterating over random-access collections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Jobs; | |
using BenchmarkDotNet.Running; | |
namespace MyBenchmarks | |
{ | |
[SimpleJob(RuntimeMoniker.NetCoreApp31)] | |
[SimpleJob(RuntimeMoniker.Net50)] | |
[SimpleJob(RuntimeMoniker.Net48)] | |
[MemoryDiagnoser] | |
[RankColumn] | |
[HtmlExporter] | |
[MarkdownExporterAttribute.Default] | |
public class Benchmark | |
{ | |
int[] _array; | |
IReadOnlyList<int> _arrayIntf; | |
List<int> _list; | |
IReadOnlyList<int> _listIntf; | |
[Params(10, 1000)] | |
public int N; | |
[GlobalSetup] | |
public void GlobalSetup() | |
{ | |
var random = new Random(); | |
_arrayIntf = _array = Enumerable.Range(0, N).Select(_ => random.Next()).ToArray(); | |
_listIntf = _list = _array.ToList(); | |
} | |
[Benchmark] | |
public int Array_ForEach() | |
{ | |
int result = 0; | |
foreach (var item in _array) | |
result += item; | |
return result; | |
} | |
[Benchmark] | |
public int Array_For() | |
{ | |
int result = 0; | |
for (int i = 0; i < _array.Length; i++) | |
result += _array[i]; | |
return result; | |
} | |
[Benchmark] | |
public int Array_ForWithCountCached() | |
{ | |
int result = 0; | |
for (int i = 0, n = _array.Length; i < n; i++) | |
result += _array[i]; | |
return result; | |
} | |
[Benchmark] | |
public int ArrayThroughIntf_ForEach() | |
{ | |
int result = 0; | |
foreach (var item in _arrayIntf) | |
result += item; | |
return result; | |
} | |
[Benchmark] | |
public int ArrayThroughIntf_For() | |
{ | |
int result = 0; | |
for (int i = 0; i < _arrayIntf.Count; i++) | |
result += _arrayIntf[i]; | |
return result; | |
} | |
[Benchmark] | |
public int ArrayThroughIntf_ForWithCountCached() | |
{ | |
int result = 0; | |
for (int i = 0, n = _arrayIntf.Count; i < n; i++) | |
result += _arrayIntf[i]; | |
return result; | |
} | |
[Benchmark] | |
public int List_ForEach() | |
{ | |
int result = 0; | |
foreach (var item in _list) | |
result += item; | |
return result; | |
} | |
[Benchmark] | |
public int List_For() | |
{ | |
int result = 0; | |
for (int i = 0; i < _list.Count; i++) | |
result += _list[i]; | |
return result; | |
} | |
[Benchmark] | |
public int List_ForWithCountCached() | |
{ | |
int result = 0; | |
for (int i = 0, n = _list.Count; i < n; i++) | |
result += _list[i]; | |
return result; | |
} | |
[Benchmark] | |
public int ListThroughIntf_ForEach() | |
{ | |
int result = 0; | |
foreach (var item in _listIntf) | |
result += item; | |
return result; | |
} | |
[Benchmark] | |
public int ListThroughIntf_For() | |
{ | |
int result = 0; | |
for (int i = 0; i < _listIntf.Count; i++) | |
result += _listIntf[i]; | |
return result; | |
} | |
[Benchmark] | |
public int ListThroughIntf_ForWithCountCached() | |
{ | |
int result = 0; | |
for (int i = 0, n = _listIntf.Count; i < n; i++) | |
result += _listIntf[i]; | |
return result; | |
} | |
} | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
BenchmarkRunner.Run<Benchmark>(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFrameworks>net48;netcoreapp31;net5</TargetFrameworks> | |
<LangVersion>9</LangVersion> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="BenchmarkDotNet" Version="0.13.0" /> | |
</ItemGroup> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang='en'> | |
<head> | |
<meta charset='utf-8' /> | |
<title>MyBenchmarks.Benchmark-20210801-130820</title> | |
<style type="text/css"> | |
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; } | |
td, th { padding: 6px 13px; border: 1px solid #ddd; text-align: right; } | |
tr { background-color: #fff; border-top: 1px solid #ccc; } | |
tr:nth-child(even) { background: #f8f8f8; } | |
</style> | |
</head> | |
<body> | |
<pre><code> | |
BenchmarkDotNet=v0.13.0, OS=Windows 10.0.19041.1110 (2004/May2020Update/20H1) | |
AMD Ryzen 7 2700X, 1 CPU, 16 logical and 8 physical cores | |
.NET SDK=5.0.302 | |
[Host] : .NET 5.0.8 (5.0.821.31504), X64 RyuJIT | |
.NET 5.0 : .NET 5.0.8 (5.0.821.31504), X64 RyuJIT | |
.NET Core 3.1 : .NET Core 3.1.17 (CoreCLR 4.700.21.31506, CoreFX 4.700.21.31502), X64 RyuJIT | |
.NET Framework 4.8 : .NET Framework 4.8 (4.8.4390.0), X64 RyuJIT | |
</code></pre> | |
<pre><code></code></pre> | |
<table> | |
<thead><tr><th> Method</th><th> Job</th><th> Runtime</th><th>N</th><th> Mean</th><th>Error</th><th>StdDev</th><th>Rank</th><th>Gen 0</th><th>Gen 1</th><th>Gen 2</th><th>Allocated</th> | |
</tr> | |
</thead><tbody><tr><td>Array_ForEach</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>2.764 ns</td><td>0.0314 ns</td><td>0.0278 ns</td><td>1</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_For</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>5.730 ns</td><td>0.0063 ns</td><td>0.0056 ns</td><td>6</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForWithCountCached</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>4.437 ns</td><td>0.0057 ns</td><td>0.0054 ns</td><td>3</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForEach</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>54.627 ns</td><td>0.1866 ns</td><td>0.1746 ns</td><td>22</td><td>0.0076</td><td>-</td><td>-</td><td>32 B</td> | |
</tr><tr><td>ArrayThroughIntf_For</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>46.133 ns</td><td>0.1378 ns</td><td>0.1222 ns</td><td>19</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForWithCountCached</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>29.207 ns</td><td>0.2206 ns</td><td>0.2063 ns</td><td>14</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForEach</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>33.670 ns</td><td>0.3623 ns</td><td>0.3389 ns</td><td>17</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_For</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>10.573 ns</td><td>0.0380 ns</td><td>0.0337 ns</td><td>9</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForWithCountCached</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>5.803 ns</td><td>0.0390 ns</td><td>0.0346 ns</td><td>6</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForEach</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>83.733 ns</td><td>0.0443 ns</td><td>0.0393 ns</td><td>24</td><td>0.0095</td><td>-</td><td>-</td><td>40 B</td> | |
</tr><tr><td>ListThroughIntf_For</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>41.603 ns</td><td>0.2622 ns</td><td>0.2452 ns</td><td>18</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForWithCountCached</td><td>.NET 5.0</td><td>.NET 5.0</td><td>10</td><td>29.753 ns</td><td>0.4594 ns</td><td>0.4297 ns</td><td>15</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForEach</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>2.951 ns</td><td>0.0298 ns</td><td>0.0233 ns</td><td>2</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_For</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>5.769 ns</td><td>0.0300 ns</td><td>0.0280 ns</td><td>6</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForWithCountCached</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>4.488 ns</td><td>0.0227 ns</td><td>0.0212 ns</td><td>3</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForEach</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>54.934 ns</td><td>0.1963 ns</td><td>0.1740 ns</td><td>22</td><td>0.0076</td><td>-</td><td>-</td><td>32 B</td> | |
</tr><tr><td>ArrayThroughIntf_For</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>46.648 ns</td><td>0.1736 ns</td><td>0.1539 ns</td><td>19</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForWithCountCached</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>31.315 ns</td><td>0.0639 ns</td><td>0.0567 ns</td><td>16</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForEach</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>23.470 ns</td><td>0.1766 ns</td><td>0.1474 ns</td><td>11</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_For</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>10.472 ns</td><td>0.0115 ns</td><td>0.0096 ns</td><td>9</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForWithCountCached</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>5.880 ns</td><td>0.0119 ns</td><td>0.0106 ns</td><td>7</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForEach</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>84.043 ns</td><td>0.4561 ns</td><td>0.4043 ns</td><td>24</td><td>0.0095</td><td>-</td><td>-</td><td>40 B</td> | |
</tr><tr><td>ListThroughIntf_For</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>41.587 ns</td><td>0.2087 ns</td><td>0.1850 ns</td><td>18</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForWithCountCached</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>10</td><td>26.199 ns</td><td>0.0320 ns</td><td>0.0299 ns</td><td>13</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForEach</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>5.295 ns</td><td>0.0210 ns</td><td>0.0186 ns</td><td>5</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_For</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>6.116 ns</td><td>0.1225 ns</td><td>0.1086 ns</td><td>8</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForWithCountCached</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>5.197 ns</td><td>0.0860 ns</td><td>0.0671 ns</td><td>4</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForEach</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>59.928 ns</td><td>0.1523 ns</td><td>0.1272 ns</td><td>23</td><td>0.0076</td><td>-</td><td>-</td><td>32 B</td> | |
</tr><tr><td>ArrayThroughIntf_For</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>50.317 ns</td><td>0.0809 ns</td><td>0.0756 ns</td><td>21</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForWithCountCached</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>29.719 ns</td><td>0.0416 ns</td><td>0.0389 ns</td><td>15</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForEach</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>25.563 ns</td><td>0.2815 ns</td><td>0.2634 ns</td><td>12</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_For</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>12.076 ns</td><td>0.0811 ns</td><td>0.0677 ns</td><td>10</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForWithCountCached</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>10.515 ns</td><td>0.0704 ns</td><td>0.0624 ns</td><td>9</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForEach</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>85.769 ns</td><td>1.5745 ns</td><td>1.3148 ns</td><td>25</td><td>0.0095</td><td>-</td><td>-</td><td>40 B</td> | |
</tr><tr><td>ListThroughIntf_For</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>48.001 ns</td><td>0.1768 ns</td><td>0.1654 ns</td><td>20</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForWithCountCached</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>10</td><td>25.306 ns</td><td>0.0888 ns</td><td>0.0830 ns</td><td>12</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForEach</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>333.620 ns</td><td>1.1839 ns</td><td>1.1075 ns</td><td>26</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_For</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>481.053 ns</td><td>3.4859 ns</td><td>3.2607 ns</td><td>28</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForWithCountCached</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>482.884 ns</td><td>3.5214 ns</td><td>3.2939 ns</td><td>28</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForEach</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>3,667.564 ns</td><td>10.9417 ns</td><td>10.2349 ns</td><td>37</td><td>0.0076</td><td>-</td><td>-</td><td>32 B</td> | |
</tr><tr><td>ArrayThroughIntf_For</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>3,847.360 ns</td><td>1.3185 ns</td><td>1.0294 ns</td><td>38</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForWithCountCached</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>1,950.561 ns</td><td>18.2296 ns</td><td>17.0520 ns</td><td>33</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForEach</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>1,902.189 ns</td><td>1.4401 ns</td><td>1.2766 ns</td><td>32</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_For</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>982.177 ns</td><td>0.7568 ns</td><td>0.7079 ns</td><td>31</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForWithCountCached</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>499.432 ns</td><td>3.8699 ns</td><td>3.4306 ns</td><td>29</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForEach</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>6,165.530 ns</td><td>100.0242 ns</td><td>93.5627 ns</td><td>40</td><td>0.0076</td><td>-</td><td>-</td><td>40 B</td> | |
</tr><tr><td>ListThroughIntf_For</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>3,375.480 ns</td><td>6.3734 ns</td><td>5.6499 ns</td><td>36</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForWithCountCached</td><td>.NET 5.0</td><td>.NET 5.0</td><td>1000</td><td>1,950.926 ns</td><td>16.7554 ns</td><td>15.6730 ns</td><td>33</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForEach</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>339.781 ns</td><td>1.0138 ns</td><td>0.8987 ns</td><td>27</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_For</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>481.480 ns</td><td>2.9302 ns</td><td>2.7409 ns</td><td>28</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForWithCountCached</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>477.041 ns</td><td>1.3758 ns</td><td>1.2869 ns</td><td>28</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForEach</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>3,651.063 ns</td><td>3.1690 ns</td><td>2.4742 ns</td><td>37</td><td>0.0076</td><td>-</td><td>-</td><td>32 B</td> | |
</tr><tr><td>ArrayThroughIntf_For</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>3,848.144 ns</td><td>3.1317 ns</td><td>2.7761 ns</td><td>38</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForWithCountCached</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>2,426.128 ns</td><td>8.7288 ns</td><td>7.7379 ns</td><td>35</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForEach</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>1,944.994 ns</td><td>1.1358 ns</td><td>1.0624 ns</td><td>33</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_For</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>990.250 ns</td><td>3.6897 ns</td><td>3.0811 ns</td><td>31</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForWithCountCached</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>491.413 ns</td><td>1.1696 ns</td><td>0.9767 ns</td><td>29</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForEach</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>6,304.621 ns</td><td>11.4006 ns</td><td>9.5200 ns</td><td>41</td><td>0.0076</td><td>-</td><td>-</td><td>40 B</td> | |
</tr><tr><td>ListThroughIntf_For</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>3,396.596 ns</td><td>9.0306 ns</td><td>8.0053 ns</td><td>36</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForWithCountCached</td><td>.NET Core 3.1</td><td>.NET Core 3.1</td><td>1000</td><td>1,934.384 ns</td><td>3.1213 ns</td><td>2.9197 ns</td><td>33</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForEach</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>494.689 ns</td><td>0.4791 ns</td><td>0.4001 ns</td><td>29</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_For</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>494.352 ns</td><td>0.6262 ns</td><td>0.5858 ns</td><td>29</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>Array_ForWithCountCached</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>495.340 ns</td><td>0.3964 ns</td><td>0.3708 ns</td><td>29</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForEach</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>3,907.519 ns</td><td>6.7850 ns</td><td>6.3467 ns</td><td>38</td><td>0.0076</td><td>-</td><td>-</td><td>32 B</td> | |
</tr><tr><td>ArrayThroughIntf_For</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>3,877.308 ns</td><td>5.0694 ns</td><td>4.2332 ns</td><td>38</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ArrayThroughIntf_ForWithCountCached</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>2,424.867 ns</td><td>3.9312 ns</td><td>3.4849 ns</td><td>35</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForEach</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>1,938.880 ns</td><td>2.3682 ns</td><td>2.2152 ns</td><td>33</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_For</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>999.411 ns</td><td>9.0302 ns</td><td>8.4469 ns</td><td>31</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>List_ForWithCountCached</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>736.952 ns</td><td>2.7980 ns</td><td>2.4803 ns</td><td>30</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForEach</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>5,585.675 ns</td><td>14.7446 ns</td><td>12.3124 ns</td><td>39</td><td>0.0076</td><td>-</td><td>-</td><td>40 B</td> | |
</tr><tr><td>ListThroughIntf_For</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>3,631.933 ns</td><td>4.0610 ns</td><td>3.7987 ns</td><td>37</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr><tr><td>ListThroughIntf_ForWithCountCached</td><td>.NET Framework 4.8</td><td>.NET Framework 4.8</td><td>1000</td><td>2,279.616 ns</td><td>3.0973 ns</td><td>2.8972 ns</td><td>34</td><td>-</td><td>-</td><td>-</td><td>-</td> | |
</tr></tbody></table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results in markdown format