Skip to content

Benchmarks for #111586 (jkotas) #557

@EgorBot

Description

@EgorBot

Processing dotnet/runtime#111586 (comment) command:

Command

-arm

using System;
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

namespace BenchmarkGround
{
public class Bench
{
public IEnumerable<object[]> Args =>
[
["Foo", "FooBar"],
["Foo", "Bar"],
["A quick brown fox jumps over a lazy dog", "A quick brown fox jumps over a lazy hog"],
[new string([.. Enumerable.Repeat('a', 1000), '1']), new string([.. Enumerable.Repeat('a', 1000), '2'])],
];

    [Benchmark]
    [ArgumentsSource(nameof(Args))]
    public int Compare(string left, string right) => string.Compare(left, right, StringComparison.Ordinal);

    [Benchmark]
    [ArgumentsSource(nameof(Args))]
    public int CompareOridinal(string left, string right) => string.CompareOrdinal(left, right);
}

}

(EgorBot will reply in this issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions