-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Processing dotnet/runtime#117800 (comment) command:
Command
-amd -arm -mono --envvars MONO_ENV_OPTIONS:"--interpreter"
using System;
using System.Linq;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkSwitcher.FromAssembly(typeof(Bench).Assembly).Run(args);
public class Bench
{
public unsafe byte* ptr;
[GlobalSetup]
public unsafe void Setup()
{
ptr = (byte*)NativeMemory.AlignedAlloc(4096, 4096);
new Random(42).NextBytes(MemoryMarshal.CreateSpan(ref *ptr, 4096));
MemoryMarshal.CreateSpan(ref *ptr, 4096).Replace<byte>(42, 0x42);
}
[Benchmark]
public unsafe bool Test()
{
return MemoryMarshal.CreateSpan(ref *ptr, 4096).Contains((byte)42);
}
}(EgorBot will reply in this issue)
Metadata
Metadata
Assignees
Labels
No labels