-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Processing dotnet/runtime#123027 (comment) command:
Command
-intel -arm -windows_intel -amd --runtimes net8.0 net10.0 --envvars DOTNET_JitDisasm:Iterate_With_Span
using BenchmarkDotNet.Attributes;
using System;
using BenchmarkDotNet.Running;
BenchmarkSwitcher.FromAssembly(typeof(Benchmarks).Assembly).Run(args);
[MemoryDiagnoser]
public class Benchmarks
{
const int N = 1000000;
float[] _data;
[GlobalSetup]
public void Setup()
{
_data = new float[N];
for (int i = 0; i < N; i++) _data[i] = 1;
}
[Benchmark]
public double Iterate_With_Span()
{
double result = 0;
Span<float> span = _data;
for (int i = 0; i < N; i++)
{
result += span[i];
}
return result;
}
}(EgorBot will reply in this issue)
Metadata
Metadata
Assignees
Labels
No labels