EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

test #121

Open EgorBo opened 1 month ago

EgorBo commented 1 month ago

@EgorBot -commit main -intel -arm64 -profiler

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

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

[GcServer(true)]
public class Bench
{
    private static object[] Src1 = Enumerable.Range(0, 10).Select(i => (object)i).ToArray();
    private static object[] Src2 = Enumerable.Range(0, 128).Select(i => (object)i).ToArray();
    private static object[] Dst = new object[128];

    [Benchmark]public void CopyObjects10() => Src1.AsSpan().CopyTo(Dst);
    [Benchmark]public void CopyObjects128() => Src2.AsSpan().CopyTo(Dst);
}
EgorBot commented 1 month ago

Benchmark results on Arm64

BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
Arm64
  Job-YTMFOZ : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Job=Job-YTMFOZ  Server=True  Toolchain=CoreRun
Method Mean Error
CopyObjects10 9.963 ns 0.0010 ns
CopyObjects128 22.955 ns 0.1031 ns

BDN_Artifacts.zip

Profile for Bench_CopyObjects128:

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

Profile for Bench_CopyObjects10:

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

EgorBot commented 1 month ago

cc @EgorBo (logs)

EgorBot commented 1 month ago

Benchmark results on Intel

BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
Intel Xeon Platinum 8488C, 1 CPU, 16 logical and 8 physical cores
  Job-XUIPOB : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job=Job-XUIPOB  Server=True  Toolchain=CoreRun
Method Mean Error
CopyObjects10 10.20 ns 0.053 ns
CopyObjects128 25.93 ns 0.163 ns

BDN_Artifacts.zip

Profile for Bench_CopyObjects128:

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

Profile for Bench_CopyObjects10:

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

EgorBot commented 1 month ago

cc @EgorBo (logs)