EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for EgorBo in #108818 #119

Open EgorBot opened 1 month ago

EgorBot commented 1 month ago

Processing https://github.com/dotnet/runtime/pull/108818#issuecomment-2409035141 command:

Command -intel -gv4 -profiler ```cs using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; BenchmarkSwitcher.FromAssembly(typeof(Bencha).Assembly).Run(args); public class Bencha { static string[] Data = Enumerable.Range(1000, 5000).Select(i => i.ToString()).ToArray(); [Benchmark] public int Bench() { int sum = 0; foreach (var item in Data) if (item.StartsWith("111")) sum++; return sum; } [Benchmark] public int Bench_IgnoreCase() { int sum = 0; foreach (var item in Data) if (item.StartsWith("111", StringComparison.OrdinalIgnoreCase)) sum++; return sum; } } ```

(EgorBot will reply in this issue)