EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for EgorBo in #109036 #127

Open EgorBot opened 1 month ago

EgorBot commented 1 month ago

Processing https://github.com/dotnet/runtime/pull/109036#issuecomment-2423425137 command:

Command -arm64 -amd --envvars DOTNET_JitDisasm:Bestcase ```cs using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; public class Bench { string s = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10/"; [Benchmark] public bool Bestcase() => s.StartsWith("https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10", StringComparison.Ordinal); [Benchmark] public bool Bestcase_IgnoreCase() => s.StartsWith("https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10", StringComparison.OrdinalIgnoreCase); // Worst case: differs at 1st char: [Benchmark] public bool Worstcase() => s.StartsWith("xttps://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10", StringComparison.Ordinal); [Benchmark] public bool Worstcase_IgnoreCase() => s.StartsWith("xttps://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10", StringComparison.OrdinalIgnoreCase); } ```

(EgorBot will reply in this issue)

EgorBot commented 1 month ago

Benchmark results on Amd

BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
AMD EPYC 9R14, 1 CPU, 16 logical and 16 physical cores
  Job-JAAFPY : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-NJQEAS : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
EnvironmentVariables=DOTNET_JitDisasm=Bestcase
Method Toolchain Mean Error Ratio
Bestcase Main 1.237 ns 0.0415 ns 1.00
Bestcase PR 1.377 ns 0.0364 ns 1.11
Bestcase_IgnoreCase Main 1.745 ns 0.0531 ns 1.00
Bestcase_IgnoreCase PR 1.826 ns 0.0630 ns 1.05
Worstcase Main 1.247 ns 0.0377 ns 1.00
Worstcase PR 1.362 ns 0.0549 ns 1.09
Worstcase_IgnoreCase Main 1.745 ns 0.0576 ns 1.00
Worstcase_IgnoreCase PR 1.881 ns 0.0635 ns 1.08

BDN_Artifacts.zip

EgorBot commented 1 month ago

cc @EgorBo (logs)

EgorBot commented 1 month ago

Benchmark results on Arm64

BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
Arm64
  Job-WLBDRZ : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-BZXXWS : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
EnvironmentVariables=DOTNET_JitDisasm=Bestcase
Method Toolchain Mean Error Ratio
Bestcase Main 4.5125 ns 0.0027 ns 1.00
Bestcase PR 1.1872 ns 0.0027 ns 0.26
Bestcase_IgnoreCase Main 8.9857 ns 0.0681 ns 1.00
Bestcase_IgnoreCase PR 2.4571 ns 0.0020 ns 0.27
Worstcase Main 0.2392 ns 0.0122 ns 1.00
Worstcase PR 1.5188 ns 0.0086 ns 6.36
Worstcase_IgnoreCase Main 2.4944 ns 0.0011 ns 1.00
Worstcase_IgnoreCase PR 2.4822 ns 0.0115 ns 1.00

BDN_Artifacts.zip

EgorBot commented 1 month ago

cc @EgorBo (logs)