Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

EgorBot for davidwrighton in #113242 #311

Open

Description

@EgorBot

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)

Activity

  1. EgorBot commented on Mar 7, 2025

    @EgorBot
    OwnerAuthor

    ❌ Failed on AzureGenoa: Job failed, see logs.

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

  2. EgorBot commented on Mar 7, 2025

    @EgorBot
    OwnerAuthor

    ❌ Failed on AzureCobalt100: Job failed, see logs.

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

  3. davidwrighton commented on Mar 7, 2025

    @davidwrighton

    @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++;
            }
        }
    }
  4. EgorBot commented on Mar 7, 2025

    @EgorBot
    OwnerAuthor

    ❌ Failed on AzureCobalt100: Job failed, see logs.

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

  5. davidwrighton commented on Mar 7, 2025

    @davidwrighton

    @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++;
            }
        }
    }
  6. EgorBot commented on Mar 7, 2025

    @EgorBot
    OwnerAuthor

    ❌ Failed on AzureCascadeLake: Job failed, see logs.

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

  7. EgorBo commented on Mar 7, 2025

    @EgorBo

    @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 🙂

  8. EgorBo commented on Mar 7, 2025

    @EgorBo

    @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++;
            }
        }
    }
  9. davidwrighton commented on Mar 7, 2025

    @davidwrighton

    @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.

  10. EgorBot commented on Mar 7, 2025

    @EgorBot
    OwnerAuthor

    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.

  11. EgorBot commented on Mar 7, 2025

    @EgorBot
    OwnerAuthor

    ❌ Failed on AzureCascadeLake: Job failed, see logs.

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

  12. EgorBot commented on Mar 7, 2025

    @EgorBot
    OwnerAuthor

    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.

  13. EgorBot commented on Mar 7, 2025

    @EgorBot
    OwnerAuthor

    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.

  14. EgorBot commented on Mar 7, 2025

    @EgorBot
    OwnerAuthor

    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

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