EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for EgorBo in #108205 #96

Open EgorBot opened 4 weeks ago

EgorBot commented 4 weeks ago

Processing https://github.com/dotnet/runtime/pull/108205#issuecomment-2372168951 command:

Command -intel -aws_amd -perf ```cs using System.Buffers.Binary; using System.Runtime.InteropServices; using BenchmarkDotNet.Attributes; public unsafe class Bench { static void* src; static void* dst; [GlobalSetup] public void Setup() { src = NativeMemory.AlignedAlloc(1024 * 4, 64); dst = NativeMemory.AlignedAlloc(1024 * 4, 64); } [GlobalCleanup] public void Cleanup() { NativeMemory.AlignedFree(src); NativeMemory.AlignedFree(dst); } [Benchmark] public void Reverse() => BinaryPrimitives.ReverseEndianness( new ReadOnlySpan(src, 1024), new Span(dst, 1024)); } ```

(EgorBot will reply in this issue)

EgorBot commented 4 weeks ago

Benchmark results on AwsAmd

BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
AMD EPYC 9R14, 1 CPU, 8 logical and 8 physical cores
  Job-UDIOYI : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-LTTDWU : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain Mean Error Ratio
Reverse Main 74.22 ns 0.010 ns 1.00
Reverse PR 34.95 ns 0.014 ns 0.47

BDN_Artifacts.zip

Profile for Bench_Reverse:

Flame graphs: Main vs PR 🔥 Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR

EgorBot commented 4 weeks ago

cc @EgorBo (logs)

EgorBot commented 4 weeks ago

Benchmark results on AzureIntel

BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
  Job-XPIIHJ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-OBKEUT : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain Mean Error Ratio
Reverse Main 75.37 ns 0.076 ns 1.00
Reverse PR 52.55 ns 0.021 ns 0.70

BDN_Artifacts.zip

Profile for Bench_Reverse:

Flame graphs: Main vs PR 🔥 Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR

EgorBot commented 4 weeks ago

cc @EgorBo (logs)