EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for EgorBo in #108575 #112

Open EgorBot opened 1 month ago

EgorBot commented 1 month ago

Processing https://github.com/dotnet/runtime/pull/108575#issuecomment-2395193181 command:

Command -mono -intel -arm64 --envvars MONO_ENV_OPTIONS:--interpreter ```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 month 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-VLFTWP : .NET 10.0.0 (42.42.42.42424) using MonoVM, X64 AOT
  Job-MARSJF : .NET 10.0.0 (42.42.42.42424) using MonoVM, X64 AOT
EnvironmentVariables=MONO_ENV_OPTIONS=--interpreter
Method Toolchain Mean Error Ratio
WriteBools Main 14.46 μs 0.019 μs 1.00
WriteBools PR 16.54 μs 0.027 μs 1.14

BDN_Artifacts.zip

EgorBot commented 1 month ago

cc @EgorBo (logs)

EgorBot commented 1 month ago

Benchmark results on AzureAmpere

BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
AzureAmpere
  Job-CCSGNY : .NET 10.0.0 (42.42.42.42424) using MonoVM, Arm64 AOT
  Job-XBLHMZ : .NET 10.0.0 (42.42.42.42424) using MonoVM, Arm64 AOT
EnvironmentVariables=MONO_ENV_OPTIONS=--interpreter
Method Toolchain Mean Error Ratio
WriteBools Main 22.00 μs 0.440 μs 1.00
WriteBools PR 26.90 μs 0.529 μs 1.22

BDN_Artifacts.zip

EgorBot commented 1 month ago

cc @EgorBo (logs)