Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EgorBot for EgorBo in #110831 #212

Open
EgorBot opened this issue Dec 19, 2024 · 2 comments
Open

EgorBot for EgorBo in #110831 #212

EgorBot opened this issue Dec 19, 2024 · 2 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented Dec 19, 2024

Processing dotnet/runtime#110831 (comment) command:

Command

-windows_intel -linux_amd --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

BenchmarkRunner.Run<Benchmark<Test, Test, Test, TestClass, TestClass>>(args: args);

public class Benchmark<T, U, V, W, X> where T : ITest, new() where U : struct, ITest where V : unmanaged, ITest where W : ITest, new() where X : class, ITest, new()
{
    private readonly ITest Test1 = new Test();
    private readonly U Test3;
    private readonly V Test4;
    private readonly Test Test5;
    private readonly W Test7 = new();

    [Benchmark]
    public void RunClassWhereTIsOneInterface()
    {
        for (long idx = 0; idx < 1_000_000_000; ++idx)
            Test7.Run();
    }
}
public interface ITest
{
    int Count { get; }
    void Run();
}
public struct Test : ITest
{
    public int Count { get; private set; }
    public void Run() => Count++;
}
public class TestClass : ITest
{
    public int Count { get; private set; }
    public void Run() => Count++;
}

(EgorBot will reply in this issue)

@EgorBot
Copy link
Owner Author

EgorBot commented Dec 19, 2024

Benchmark results on linux_azure_genoa

BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
AMD EPYC 9V74, 1 CPU, 4 logical and 2 physical cores
  Job-LYAGAV : .NET 8.0.11 (8.0.1124.51707), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-OFXAVA : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Runtime Mean Error Ratio
RunClassWhereTIsOneInterface .NET 8.0 391.6 ms 4.43 ms 1.00
RunClassWhereTIsOneInterface .NET 9.0 385.9 ms 0.11 ms 0.99

BDN_Artifacts.zip

cc @EgorBo (agent_logs.txt). EgorBot manual: link.

@EgorBot
Copy link
Owner Author

EgorBot commented Dec 19, 2024

Benchmark results on windows_azure_cascadelake

BenchmarkDotNet v0.14.0, Windows 11 (10.0.26100.2314) (Hyper-V)
azure_cascadelake
  Job-XYSHPH : .NET 8.0.11 (8.0.1124.51707), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-VBTGDM : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Runtime Mean Error Ratio
RunClassWhereTIsOneInterface .NET 8.0 2.145 s 0.0037 s 1.00
RunClassWhereTIsOneInterface .NET 9.0 2.146 s 0.0018 s 1.00

BDN_Artifacts.zip

cc @EgorBo (agent_logs.txt). EgorBot manual: link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant