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.

Benchmarks for #117583 (EgorBo) #436

Open

Description

@EgorBot

Processing dotnet/runtime#117583 (comment) command:

Command

-amd -arm -windows_intel

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

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

public class Benchmarks
{
    static object[] _strings = new string[4];

    [Benchmark]
    public void AssignString()
    {
        var arr = _strings;
        if (arr.Length >= 4)
        {
            arr[0] = "";
            arr[1] = "";
            arr[2] = "";
            arr[3] = "";
        }
    }

    [Benchmark]
    public void SwapElements()
    {
        var arr = _strings;
        (arr[1], arr[0]) = (arr[0], arr[1]);
    }

    [Benchmark]
    public void SingleAssignment()
    {
        _strings[0] = "";
    }
}

(EgorBot will reply in this issue)

Activity

  1. EgorBot commented on Jul 13, 2025

    @EgorBot
    OwnerAuthor

    Benchmark results on linux_azure_genoa

    BenchmarkDotNet v0.15.0, Linux Ubuntu 24.04.2 LTS (Noble Numbat)
    AMD EPYC 9V74, 1 CPU, 16 logical and 8 physical cores
      Job-CZCOUG : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
      Job-CLALXA : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
    
    Method Toolchain Mean Error Ratio
    AssignString Main 7.5633 ns 0.0022 ns 1.00
    AssignString PR 1.3160 ns 0.0033 ns 0.17
    SwapElements Main 2.9979 ns 0.0008 ns 1.00
    SwapElements PR 1.0471 ns 0.0012 ns 0.35
    SingleAssignment Main 1.9075 ns 0.0005 ns 1.00
    SingleAssignment PR 0.2723 ns 0.0002 ns 0.14

    BDN_Artifacts.zip

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

  2. EgorBot commented on Jul 13, 2025

    @EgorBot
    OwnerAuthor

    Benchmark results on linux_azure_cobalt100

    BenchmarkDotNet v0.15.0, Linux Ubuntu 24.04.2 LTS (Noble Numbat)
    Neoverse-N2, 16 physical cores
      Job-ZYNMKL : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
      Job-HDSIXC : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
    
    Method Toolchain Mean Error Ratio
    AssignString Main 10.3296 ns 0.0032 ns 1.00
    AssignString PR 1.8738 ns 0.0006 ns 0.18
    SwapElements Main 2.6604 ns 0.0012 ns 1.00
    SwapElements PR 1.1768 ns 0.0024 ns 0.44
    SingleAssignment Main 1.9655 ns 0.0023 ns 1.00
    SingleAssignment PR 0.3821 ns 0.0003 ns 0.19

    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