EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for EgorBo in #9 #19

Open EgorBot opened 2 months ago

EgorBot commented 2 months ago

Processing https://github.com/EgorBot/runtime-utils/issues/9#issuecomment-2323570651 command:


-intel -arm64 -perf -commit main

using System;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

BenchmarkRunner.Run<Bench>(args: args);

public class Bench
{
    [Benchmark]
    public void Foo()
    {
        for (int i = 0; i < 1000; i++)
            Work<char>(1);
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    static void Work<T>(int size) => GC.KeepAlive(GC.AllocateUninitializedArray<T>(size));
}

(EgorBot will reply in this issue)

EgorBot commented 2 months ago

Benchmark results on Intel

BenchmarkDotNet v0.14.0, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
  Job-CRINJA : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job=Job-CRINJA  Toolchain=CoreRun  StdDev=0.1474 μs
Method Mean Error
Foo 9.131 μs 0.1575 μs

BDN_Artifacts.zip

🔥 Flame graphs: Main Hot asm: Main Hot functions: Main

For clean perf results, make sure you have just one [Benchmark] in your app.

EgorBot commented 2 months ago

Build log

cc @EgorBo

EgorBot commented 2 months ago

Benchmark results on Arm64

BenchmarkDotNet v0.14.0, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
Unknown processor
  Job-VSXXJX : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Job=Job-VSXXJX  Toolchain=CoreRun  StdDev=0.1003 μs
Method Mean Error
Foo 9.607 μs 0.1072 μs

BDN_Artifacts.zip

🔥 Flame graphs: Main Hot asm: Main Hot functions: Main

For clean perf results, make sure you have just one [Benchmark] in your app.

EgorBot commented 2 months ago

Build log

cc @EgorBo