-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Processing dotnet/runtime#116453 (comment) command:
Command
-intel -arm64 --envvars DOTNET_JitDisasm:GenericEquals
using System;
using BenchmarkDotNet.Attributes;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Running;
public class StringComparisons
{
private string s1 = "test string 1";
private string s2 = "test string 2";
[Benchmark]
public bool Equals_inline() => string.Equals(s1, s2);
[Benchmark]
public bool Equals_specialized() => EqualityComparer<string>.Default.Equals(s1, s2);
[Benchmark]
public bool Equals_generic() => GenericEquals(s1, s2);
[MethodImpl(MethodImplOptions.NoInlining)]
private static bool GenericEquals<T>(T a, T b) => EqualityComparer<T>.Default.Equals(a, b);
}(EgorBot will reply in this issue)
Metadata
Metadata
Assignees
Labels
No labels