Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Benchmarks for #113715 (AaronRobinsonMSFT) #320

Description

@EgorBot

Processing dotnet/runtime#113715 (comment) command:

Command

-windows_x64 -arm64

using System;
using System.Runtime.CompilerServices;

using BenchmarkDotNet.Attributes;

public unsafe class Bench
{
    private F _f;
    private byte[] _source;
    private byte[] _dest;
    private delegate* <ref byte, ref byte, nuint, void> _method;

    class F
    {
        ~F() { }
    }

    public Bench()
    {
        _f = new F();
        _source = new byte[10 * 1024];
        _dest = new byte[_source.Length];
        Random random = new Random();
        random.NextBytes(array);

        var method = typeof(Buffer).GetMethod("BulkMoveWithWriteBarrier", BindingFlags.NonPublic | BindingFlags.Static);
        _method = (delegate* <ref byte, ref byte, nuint, void>)method.MethodHandle.GetFunctionPointer();
    }

    [Benchmark]
    public void BenchmarkBulkMoveWithWriteBarrier()
    {
        _method(ref _dest[0], ref _source[0], (nuint)dest.Length);
    }

    [Benchmark]
    public void BenchmarkSuppressFinalize()
    {
        GC.SuppressFinalize(_f);
    }
}

(EgorBot will reply in this issue)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions