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

Benchmarks for #113575 (EgorBo) #318

Open
EgorBot opened this issue Mar 19, 2025 · 2 comments
Open

Benchmarks for #113575 (EgorBo) #318

EgorBot opened this issue Mar 19, 2025 · 2 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented Mar 19, 2025

Processing dotnet/runtime#113575 (comment) command:

Command

-amd -arm -profiler

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

public class Bench
{
    byte[] _arr1 = new byte[2000];
    byte[] _arr2 = new byte[2000];

    [Benchmark]
    [Arguments(1000)]
    public void CopyN(int elems)
    {
        Span<byte> span1 = _arr1;
        Span<byte> span2 = _arr2;

        for (int i = 0; i < elems; i++)
            span1[i] = span2[i];
    }


    [Benchmark]
    [Arguments(1000)]
    public void ReversedIter(int elems)
    {
        Span<byte> span = _arr1;

        // Reversed iteration
        for (int i = span.Length - 1; i >= 0; i--)
            span[i] = 42;
    }
}

(EgorBot will reply in this issue)

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 19, 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-DBDRMK : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-NDYHMJ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain elems Mean Error Ratio
CopyN Main 1000 414.3 ns 0.03 ns 1.00
CopyN PR 1000 277.0 ns 0.03 ns 0.67
ReversedIter Main 1000 552.5 ns 0.24 ns 1.00
ReversedIter PR 1000 552.0 ns 0.08 ns 1.00

BDN_Artifacts.zip

Profiling for Bench_CopyN:

SVG flamegraph: Main vs PR 🔥
Speedscope flamegraph: Main vs PR
Hot asm code: Main vs PR
HW counters: Main vs PR

Profiling for Bench_ReversedIter:

SVG flamegraph: Main vs PR 🔥
Speedscope flamegraph: Main vs PR
Hot asm code: Main vs PR
HW counters: Main vs PR


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

@EgorBot
Copy link
Owner Author

EgorBot commented Mar 19, 2025

Benchmark results on linux_azure_cobalt100

BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
azure_cobalt100
  Job-QLIBBY : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-NQRDYW : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method Toolchain elems Mean Error Ratio
CopyN Main 1000 476.4 ns 0.37 ns 1.00
CopyN PR 1000 358.4 ns 0.23 ns 0.75
ReversedIter Main 1000 599.2 ns 3.77 ns 1.00
ReversedIter PR 1000 596.3 ns 0.02 ns 1.00

BDN_Artifacts.zip

Profiling for Bench_CopyN:

SVG flamegraph: Main vs PR 🔥
Speedscope flamegraph: Main vs PR
Hot asm code: Main vs PR
HW counters: Main vs PR

Profiling for Bench_ReversedIter:

SVG flamegraph: Main vs PR 🔥
Speedscope flamegraph: Main vs PR
Hot asm code: Main vs PR
HW counters: Main vs PR


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