EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for xtqqczze in #108572 #110

Open EgorBot opened 1 day ago

EgorBot commented 1 day ago

Processing https://github.com/dotnet/runtime/pull/108572#issuecomment-2395155316 command:

Command -intel -arm64 -profiler ```cs using System.Runtime.CompilerServices; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); public class Benchmarks { static bool[] _values = Enumerable.Range(0, 256).Select(i => i % 2 == 0).ToArray(); static char[] _output = new char[4096]; [Benchmark] public void WriteBools() { Span output = _output; foreach (var value in _values) { if (value.TryFormat(output, out int written)) output = output.Slice(written); else throw new InvalidOperationException(); } Consume(output); } [MethodImpl(MethodImplOptions.NoInlining)] void Consume(Span _){} } ```

(EgorBot will reply in this issue)

EgorBot commented 1 day 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, 8 logical and 4 physical cores
  Job-JEYQVG : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-COGXPA : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
StdDev=0.04 ns
Method Toolchain Mean Error Ratio
WriteBools Main 338.3 ns 0.04 ns 1.00
WriteBools PR 227.9 ns 0.04 ns 0.67

BDN_Artifacts.zip

Profile for Benchmarks_WriteBools:

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 day ago

cc @xtqqczze (logs)

EgorBot commented 1 day ago

Benchmark results on AzureAmpere

BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
AzureAmpere
  Job-MGCVPH : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-MYBVUE : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method Toolchain Mean Error Ratio
WriteBools Main 604.1 ns 0.33 ns 1.00
WriteBools PR 477.4 ns 0.03 ns 0.79

BDN_Artifacts.zip

Profile for Benchmarks_WriteBools:

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 day ago

cc @xtqqczze (logs)