Open
Description
Processing dotnet/runtime#108575 (comment) command:
Command
-mono -intel -arm64
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
public class Benchmarks
{
static bool[] _values = Enumerable.Range(0, 256).Select(i => i % 2 == 0).ToArray();
static char[] _output = new char[4096];
[Benchmark]
public void WriteBools()
{
Span<char> output = _output;
foreach (var value in _values)
{
if (value.TryFormat(output, out int written))
output = output.Slice(written);
else
throw new InvalidOperationException();
}
Consume(output);
}
[MethodImpl(MethodImplOptions.NoInlining)]
void Consume(Span<char> _){}
}
(EgorBot will reply in this issue)
Metadata
Metadata
Assignees
Labels
No labels