Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EgorBot for EgorBo in #109036 #127

Open
EgorBot opened this issue Oct 19, 2024 · 4 comments
Open

EgorBot for EgorBo in #109036 #127

EgorBot opened this issue Oct 19, 2024 · 4 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented Oct 19, 2024

Processing dotnet/runtime#109036 (comment) command:

Command

-arm64 -amd --envvars DOTNET_JitDisasm:Bestcase

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
Copy link
Owner Author

EgorBot commented Oct 19, 2024

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
Copy link
Owner Author

EgorBot commented Oct 19, 2024

cc @EgorBo (logs)

@EgorBot
Copy link
Owner Author

EgorBot commented Oct 19, 2024

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
Copy link
Owner Author

EgorBot commented Oct 19, 2024

cc @EgorBo (logs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant