Skip to content

EgorBot for EgorBo in #111911 #268

Open
@EgorBot

Description

@EgorBot

Processing dotnet/runtime#111911 (comment) command:

Command

-amd -mono -commit main --envvars MONO_VERBOSE_METHOD:TestMethod

using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;

public class Benchmarks
{
    private static ReadOnlySpan<byte> TwoDigitsCharsAsBytes =>
        MemoryMarshal.AsBytes<char>("00010203040506070809" +
                                    "10111213141516171819" +
                                    "20212223242526272829" +
                                    "30313233343536373839" +
                                    "40414243444546474849" +
                                    "50515253545556575859" +
                                    "60616263646566676869" +
                                    "70717273747576777879" +
                                    "80818283848586878889" +
                                    "90919293949596979899");

    [MethodImpl(MethodImplOptions.NoInlining)]  
    static byte TestMethod(int i)
    {
        return TwoDigitsCharsAsBytes[i];
    }

    [Benchmark]
    public byte Bench()
    {
        return TestMethod(1);
    }
}

(EgorBot will reply in this issue)

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