You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Benchmark]
public int IntSpanESumLinq()
{
int val = 0;
foreach (int i in intArray.AsSpan())
{
val += i;
}
return val;
}
[Benchmark]
public int IntSpanFSumLinq()
{
int val = 0;
Span<int> span = intArray.AsSpan();
for (int index = 0; index < span.Length; index++)
{
val += span[index];
}
return val;
}
[Benchmark]
public int IntSpanSumFast()
{
return intArray.AsSpan().SumF();
}