-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Improve IndexOf(char, OrdinalIgnoreCase) #73533
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
…ng.cs Co-authored-by: Stephen Toub <[email protected]>
Tagging subscribers to this area: @dotnet/area-system-runtime Issue DetailsA similar trick is used for Benchmark: using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkSwitcher.FromAssembly(typeof(Benchmarks).Assembly).Run(args);
public class Benchmarks
{
const string TestStr =
".NET Runtime uses third-party libraries or other resources that may be" +
" distributed under licenses different than the.NET Runtime software.";
[Benchmark]
public int IndexOfDash() => TestStr.IndexOf('-', StringComparison.OrdinalIgnoreCase);
[Benchmark]
public int IndexOfL() => TestStr.IndexOf('L', StringComparison.OrdinalIgnoreCase);
[Benchmark]
public int IndexOfZ() => TestStr.IndexOf('z', StringComparison.OrdinalIgnoreCase);
}
|
Failure is #73247 |
A similar trick is used for
IndexOf(string, OrdinalIgnoreCase)
see here.Benchmark: