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 davidwrighton in #113242 #311

Open
EgorBot opened this issue Mar 7, 2025 · 14 comments
Open

EgorBot for davidwrighton in #113242 #311

EgorBot opened this issue Mar 7, 2025 · 14 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented Mar 7, 2025

Processing dotnet/runtime#113242 (comment) command:

Command

-amd -arm -windows_intel

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Numerics;

BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);

public class Tests
{
    private obj _lockObj = new object();
    private int _field = 0;

    [Benchmark(Baseline = true)]
    public string Lock_OnLockObj()
    {
        _field++;
        lock(_lockObj)
        {
            _field++;
        }
    }

    [Benchmark]
    public bool LockOnThis_ThisKnownToBeNonNull()
    {
        _field++;
        lock(this)
        {
            _field++;
        }
    }

    [Benchmark]
    public bool LockOnThis_ThisKnownToBeNonNull()
    {
        lock(this)
        {
            _field++;
        }
    }
}

(EgorBot will reply in this issue)

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 7, 2025

❌ Failed on AzureGenoa: Job failed, see logs.

cc @davidwrighton (logs). EgorBot manual: link.

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 7, 2025

❌ Failed on AzureCobalt100: Job failed, see logs.

cc @davidwrighton (logs). EgorBot manual: link.

@davidwrighton
Copy link

davidwrighton commented Mar 7, 2025

@EgorBot -amd -arm -windows_intel

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Numerics;

BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);

public class Tests
{
    private object _lockObj = new object();
    private int _field = 0;

    [Benchmark(Baseline = true)]
    public string Lock_OnLockObj()
    {
        _field++;
        lock(_lockObj)
        {
            _field++;
        }
    }

    [Benchmark]
    public bool LockOnThis_ThisKnownToBeNonNull()
    {
        _field++;
        lock(this)
        {
            _field++;
        }
    }

    [Benchmark]
    public bool LockOnThis()
    {
        lock(this)
        {
            _field++;
        }
    }
}

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 7, 2025

❌ Failed on AzureCobalt100: Job failed, see logs.

cc @davidwrighton (logs). EgorBot manual: link.

@davidwrighton
Copy link

@EgorBot -amd -arm -windows_intel

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Numerics;

BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);

public class Tests
{
    private object _lockObj = new object();
    private int _field = 0;

    [Benchmark(Baseline = true)]
    public void Lock_OnLockObj()
    {
        _field++;
        lock(_lockObj)
        {
            _field++;
        }
    }

    [Benchmark]
    public void LockOnThis_ThisKnownToBeNonNull()
    {
        _field++;
        lock(this)
        {
            _field++;
        }
    }

    [Benchmark]
    public void LockOnThis()
    {
        lock(this)
        {
            _field++;
        }
    }
}

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 7, 2025

❌ Failed on AzureCascadeLake: Job failed, see logs.

cc @davidwrighton (logs). EgorBot manual: link.

@EgorBo
Copy link

EgorBo commented Mar 7, 2025

@davidwrighton When you run a benchmark outside of PR (e.g. in any issue), it assumes you only want results on the last .NET SDK. It needs -pr 113242 to run for a PR outside of that PR. I can probably fix it in the bot to assume PR by default when it's ran inside issues generated by previous PR runs 🙂

@EgorBo
Copy link

EgorBo commented Mar 7, 2025

@EgorBot -amd -arm -windows_intel -pr 113242

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Numerics;

BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);

public class Tests
{
    private object _lockObj = new object();
    private int _field = 0;

    [Benchmark(Baseline = true)]
    public void Lock_OnLockObj()
    {
        _field++;
        lock (_lockObj)
        {
            _field++;
        }
    }

    [Benchmark]
    public void LockOnThis_ThisKnownToBeNonNull()
    {
        _field++;
        lock (this)
        {
            _field++;
        }
    }

    [Benchmark]
    public void LockOnThis()
    {
        lock (this)
        {
            _field++;
        }
    }
}

@davidwrighton
Copy link

@EgorBo Ah, I misunderstood the purpose here. I didn't realize that just running on a .NET SDK was even a thing. Thanks for correcting this for me.

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 7, 2025

Benchmark results on windows_azure_cascadelake

BenchmarkDotNet v0.14.0, Windows 11 (10.0.26100.2314) (Hyper-V)
azure_cascadelake
DefaultJob : .NET 9.0.2 (9.0.225.6610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Mean Error Ratio
Lock_OnLockObj 19.00 ns 0.035 ns 1.00
LockOnThis_ThisKnownToBeNonNull 19.22 ns 0.033 ns 1.01
LockOnThis 18.90 ns 0.010 ns 0.99

BDN_Artifacts.zip

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

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 7, 2025

❌ Failed on AzureCascadeLake: Job failed, see logs.

cc @davidwrighton (logs). EgorBot manual: link.

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 7, 2025

Benchmark results on linux_azure_genoa

BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
AMD EPYC 9V74, 1 CPU, 16 logical and 8 physical cores
  Job-WRBFLL : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-PQOEDW : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain Mean Error Ratio
Lock_OnLockObj Main 8.804 ns 0.0952 ns 1.00
LockOnThis_ThisKnownToBeNonNull Main 7.874 ns 0.0648 ns 0.89
LockOnThis Main 7.877 ns 0.1139 ns 0.89
Lock_OnLockObj PR 7.477 ns 0.0104 ns 0.85
LockOnThis_ThisKnownToBeNonNull PR 7.276 ns 0.0990 ns 0.83
LockOnThis PR 7.336 ns 0.0661 ns 0.83

BDN_Artifacts.zip

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

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 7, 2025

Benchmark results on linux_azure_cobalt100

BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
azure_cobalt100
  Job-KIYFHT : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-RQRIPW : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method Toolchain Mean Error Ratio
Lock_OnLockObj Main 23.13 ns 0.009 ns 1.00
LockOnThis_ThisKnownToBeNonNull Main 20.61 ns 0.002 ns 0.89
LockOnThis Main 22.20 ns 0.001 ns 0.96
Lock_OnLockObj PR 20.17 ns 0.002 ns 0.87
LockOnThis_ThisKnownToBeNonNull PR 20.00 ns 0.002 ns 0.86
LockOnThis PR 20.60 ns 0.017 ns 0.89

BDN_Artifacts.zip

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

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 7, 2025

Benchmark results on windows_azure_cascadelake

BenchmarkDotNet v0.14.0, Windows 11 (10.0.26100.2314) (Hyper-V)
azure_cascadelake
  Job-PJCXJD : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-ZOPDRY : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Job Toolchain Mean Error Ratio
Lock_OnLockObj Job-PJCXJD \core_root_base\corerun.exe 19.22 ns 0.069 ns 1.00
LockOnThis_ThisKnownToBeNonNull Job-PJCXJD \core_root_base\corerun.exe 19.45 ns 0.027 ns 1.01
LockOnThis Job-PJCXJD \core_root_base\corerun.exe 19.21 ns 0.050 ns 1.00
Lock_OnLockObj Job-ZOPDRY \core_root_diff\corerun.exe 19.34 ns 0.025 ns 1.01
LockOnThis_ThisKnownToBeNonNull Job-ZOPDRY \core_root_diff\corerun.exe 19.33 ns 0.006 ns 1.01
LockOnThis Job-ZOPDRY \core_root_diff\corerun.exe 19.38 ns 0.014 ns 1.01

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

3 participants