EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for AndyAyersMS in #109209 #139

Open EgorBot opened 3 weeks ago

EgorBot commented 3 weeks ago

Processing https://github.com/dotnet/runtime/pull/109209#issuecomment-2440125268 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 } ``` The `Foreach` test should now devirtualize and stack allocate the enumerator (but not yet promote, needs #109209).

(EgorBot will reply in this issue)

EgorBot commented 3 weeks ago

❌ Failed on Arm64: Job failed, see logs.

cc @AndyAyersMS (logs)

EgorBot commented 3 weeks ago

❌ Failed on Intel: Job failed, see logs.

cc @AndyAyersMS (logs)