Open EgorBo opened 1 month ago
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.
@EgorBot -intel --runtimes net9.0 net8.0 net7.0 --disasm --envvars DOTNET_ReadyToRun:0
using BenchmarkDotNet.Attributes;
public class Bench
{
string _str1 = "1234";
string _str2 = "1235";
[Benchmark]
public bool StringEquals() => _str1 == _str2;
}
@EgorBot -intel -arm
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
BenchmarkRunner.Run<PgoBenchmarks>(args: args);
[Config(typeof(MyEnvVars))]
[HideColumns("EnvironmentVariables", "Runtime")]
[DisassemblyDiagnoser]
public class PgoBenchmarks
{
class MyEnvVars : ManualConfig
{
public MyEnvVars()
{
AddJob(Job.Default.WithId("8.0").WithRuntime(CoreRuntime.Core80));
AddJob(Job.Default.WithId("8.0 R2R=0").WithRuntime(CoreRuntime.Core80)
.WithEnvironmentVariables(
new EnvironmentVariable("DOTNET_ReadyToRun", "0")));
AddJob(Job.Default.WithId("9.0").WithRuntime(CoreRuntime.Core90));
AddJob(Job.Default.WithId("9.0 R2R=0").WithRuntime(CoreRuntime.Core90)
.WithEnvironmentVariables(
new EnvironmentVariable("DOTNET_ReadyToRun", "0")));
}
}
public static IEnumerable<object[]> TestData()
{
yield return new object[] { "1111", "1122" };
}
[Benchmark]
[ArgumentsSource(nameof(TestData))]
public bool StringEquals(string a, string b) => a == b;
}
@EgorBot -intel -arm64 -profiler -commit main
using BenchmarkDotNet.Attributes;
public class Bench
{
static object obj = new object();
[Benchmark]
public Type GetType_() => obj.GetType();
}
@EgorBot -intel -profiler -keep -commit main --envvars "DOTNETJitDisasm:GetType"
using BenchmarkDotNet.Attributes;
public class Bench
{
static object obj = new object();
[Benchmark]
public Type GetType_() => obj.GetType();
}
@EgorBot -intel -arm64 -profiler -commit main
using BenchmarkDotNet.Attributes;
public class Bench
{
static object obj = new object();
[Benchmark]
public Type GetType_() => obj.GetType();
}
@EgorBot -intel -profiler -keep -commit main --envvars "DOTNETJitDisasm:GetType"
using BenchmarkDotNet.Attributes;
public class Bench
{
static object obj = new object();
[Benchmark]
public Type GetType_() => obj.GetType();
}
@EgorBot -intel -profiler -keep -commit main --envvars "DOTNETJitDisasm:GetType"
using BenchmarkDotNet.Attributes;
public class Bench
{
static object obj = new object();
[Benchmark]
public Type GetType_() => obj.GetType();
}
@EgorBot -intel -arm64 -profiler -commit main
using BenchmarkDotNet.Attributes;
public class Bench
{
static object obj = new object();
[Benchmark]
public Type GetType_() => obj.GetType();
}
@EgorBot -arm64 -profiler -commit main
using BenchmarkDotNet.Attributes;
public class Bench
{
static object obj = new object();
[Benchmark]
public Type GetType_() => obj.GetType();
}
@EgorBot -arm64 -intel -profiler -commit main
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkRunner.Run<PgoBenchmarks>(args: args);
public class PgoBenchmarks
{
[Benchmark]
public async Task<bool> Task1() => await Task2();
[MethodImpl(MethodImplOptions.NoInlining)]
public async Task<bool> Task2() => true;
}
Seems like global assertprop bails out on the following snippet
Current codegen:
Expected codegen: