EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for EgorBo in #109014 #125

Open EgorBot opened 1 month ago

EgorBot commented 1 month ago

Processing https://github.com/dotnet/runtime/pull/109014#issuecomment-2422362712 command:

Command -intel -arm64 -profiler -nonativepgo ```cs using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; BenchmarkSwitcher.FromAssembly(typeof(Bench).Assembly).Run(args); [GcServer(true)] public class Bench { static object[] Src0 = Enumerable.Range(0, 2).Select(i => (object)i).ToArray(); static object[] Src1 = Enumerable.Range(0, 10).Select(i => (object)i).ToArray(); static object[] Src2 = Enumerable.Range(0, 128).Select(i => (object)i).ToArray(); static object[] Dst = new object[128]; [Benchmark]public void CopyObjects2() => Src0.AsSpan().CopyTo(Dst); [Benchmark]public void CopyObjects10() => Src1.AsSpan().CopyTo(Dst); [Benchmark]public void CopyObjects128() => Src2.AsSpan().CopyTo(Dst); } ```

(EgorBot will reply in this issue)

EgorBot commented 1 month ago

Benchmark results on Arm64

BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
Arm64
  Job-IUCNRB : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-YJVBKF : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Server=True
Method Toolchain Mean Error Ratio
CopyObjects2 Main 8.093 ns 0.0013 ns 1.00
CopyObjects2 PR 7.724 ns 0.0014 ns 0.95
CopyObjects10 Main 10.611 ns 0.0023 ns 1.00
CopyObjects10 PR 9.729 ns 0.0017 ns 0.92
CopyObjects128 Main 23.811 ns 0.0111 ns 1.00
CopyObjects128 PR 51.363 ns 0.1233 ns 2.16

BDN_Artifacts.zip

Profile for Bench_CopyObjects128:

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

Profile for Bench_CopyObjects2:

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

Profile for Bench_CopyObjects10:

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

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-DBRMHF : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-YPTGEU : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Server=True
Method Toolchain Mean Error Ratio
CopyObjects2 Main 8.438 ns 0.0325 ns 1.00
CopyObjects2 PR 6.560 ns 0.0429 ns 0.78
CopyObjects10 Main 8.862 ns 0.0520 ns 1.00
CopyObjects10 PR 8.021 ns 0.0712 ns 0.91
CopyObjects128 Main 18.749 ns 0.0324 ns 1.00
CopyObjects128 PR 26.767 ns 0.0521 ns 1.43

BDN_Artifacts.zip

Profile for Bench_CopyObjects128:

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

Profile for Bench_CopyObjects2:

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

Profile for Bench_CopyObjects10:

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

EgorBot commented 1 month ago

cc @EgorBo (logs)