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 #126

Open
EgorBot opened this issue Oct 18, 2024 · 2 comments
Open

EgorBot for EgorBo in #109036 #126

EgorBot opened this issue Oct 18, 2024 · 2 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented Oct 18, 2024

Processing dotnet/runtime#109036 (comment) command:

Command

-arm64 --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 18, 2024

Benchmark results on Arm64

BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
Arm64
  Job-NOPWKW : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-CAQCQB : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
EnvironmentVariables=DOTNET_JitDisasm=Bestcase
Method Toolchain Mean Error Ratio
Bestcase Main 4.6838 ns 0.0037 ns 1.00
Bestcase PR 0.8703 ns 0.0018 ns 0.19
Bestcase_IgnoreCase Main 8.6444 ns 0.0931 ns 1.00
Bestcase_IgnoreCase PR 2.1261 ns 0.0008 ns 0.25
Worstcase Main 0.6058 ns 0.0004 ns 1.00
Worstcase PR 0.7916 ns 0.0012 ns 1.31
Worstcase_IgnoreCase Main 2.5311 ns 0.0011 ns 1.00
Worstcase_IgnoreCase PR 2.2280 ns 0.0015 ns 0.88

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Oct 18, 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