-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Processing dotnet/runtime#117583 (comment) command:
Command
-amd -arm -windows_intel
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkSwitcher.FromAssembly(typeof(Benchmarks).Assembly).Run(args);
public class Benchmarks
{
static object[] _strings = new string[4];
[Benchmark]
public void AssignString()
{
var arr = _strings;
if (arr.Length >= 4)
{
arr[0] = "";
arr[1] = "";
arr[2] = "";
arr[3] = "";
}
}
[Benchmark]
public void SwapElements()
{
var arr = _strings;
(arr[1], arr[0]) = (arr[0], arr[1]);
}
[Benchmark]
public void SingleAssignment()
{
_strings[0] = "";
}
}
(EgorBot will reply in this issue)
Metadata
Metadata
Assignees
Labels
No labels