-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Processing dotnet/runtime#113575 (comment) command:
Command
-amd -arm -profiler
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Bench
{
byte[] _arr1 = new byte[2000];
byte[] _arr2 = new byte[2000];
[Benchmark]
[Arguments(1000)]
public void CopyN(int elems)
{
Span<byte> span1 = _arr1;
Span<byte> span2 = _arr2;
for (int i = 0; i < elems; i++)
span1[i] = span2[i];
}
[Benchmark]
[Arguments(1000)]
public void ReversedIter(int elems)
{
Span<byte> span = _arr1;
// Reversed iteration
for (int i = span.Length - 1; i >= 0; i--)
span[i] = 42;
}
}(EgorBot will reply in this issue)
Metadata
Metadata
Assignees
Labels
No labels