EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for AndyAyersMS in #109209 #140

Open EgorBot opened 3 weeks ago

EgorBot commented 3 weeks ago

Processing https://github.com/dotnet/runtime/pull/109209#issuecomment-2440126123 command:

Command -intel -arm64 -profiler --envvars DOTNET_JitDisasm:Foreach Count ```cs using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; using System.Runtime.CompilerServices; BenchmarkSwitcher.FromAssembly(typeof(Bench).Assembly).Run(args); public class Bench { string[] s_ro_str_array = new string[512]; [Benchmark] public int Foreach() { IEnumerable e = s_ro_str_array; int sum = 0; foreach (string s in e) sum += s == null ? 0 : s.Length; return sum; } [Benchmark] public int Count() => CountInner(s_ro_str_array); [MethodImpl(MethodImplOptions.NoInlining)] int CountInner(ICollection c) => c.Count; } ```

(EgorBot will reply in this issue)

EgorBot commented 3 weeks ago

Benchmark results on Arm64

BDN_Artifacts.zip

Profile for Bench_Foreach:

Flame graphs: Main vs PR 🔥 Speedscope: Main vs PR Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR

Profile for Bench_Count:

Flame graphs: Main vs PR 🔥 Speedscope: Main vs PR Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR

EgorBot commented 3 weeks ago

cc @AndyAyersMS (logs)

EgorBot commented 3 weeks ago

Benchmark results on Intel

BDN_Artifacts.zip

Profile for Bench_Foreach:

Flame graphs: Main vs PR 🔥 Speedscope: Main vs PR Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR

Profile for Bench_Count:

Flame graphs: Main vs PR 🔥 Speedscope: Main vs PR Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR

EgorBot commented 3 weeks ago

cc @AndyAyersMS (logs)