Skip to content

Instantly share code, notes, and snippets.

@aensidhe
Last active December 24, 2018 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aensidhe/0d412e142eb29fd21eea01b5f6462d41 to your computer and use it in GitHub Desktop.
Save aensidhe/0d412e142eb29fd21eea01b5f6462d41 to your computer and use it in GitHub Desktop.
ForEach
using System;
using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Exporters.Csv;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Toolchains.CsProj;
namespace ForEachLength
{
[Config(typeof(Config))]
public class Bench
{
private class Config : ManualConfig
{
public Config()
{
Add(Job.Default.With(Jit.RyuJit).With(Platform.X64).With(Runtime.Clr).WithBaseline(true).WithId("Clr RyuJit"));
Add(Job.Default.With(Jit.LegacyJit).With(Platform.X64).With(Runtime.Clr).WithId("Clr LegacyJit"));
Add(Job.Default.With(Jit.RyuJit).With(Platform.X64).With(Runtime.Core).With(CsProjCoreToolchain.NetCoreApp20).WithId("netcore2.0"));
Add(Job.Default.With(Jit.RyuJit).With(Platform.X64).With(Runtime.Core).With(CsProjCoreToolchain.NetCoreApp21).WithId("netcore2.1"));
Add(Job.Default.With(Jit.RyuJit).With(Platform.X64).With(Runtime.Core).With(CsProjCoreToolchain.NetCoreApp22).WithId("netcore2.2"));
Add(MarkdownExporter.GitHub);
Add(CsvMeasurementsExporter.Default);
// The same, using the .With() factory methods:
Add(DisassemblyDiagnoser.Create(new DisassemblyDiagnoserConfig()));
Add(MemoryDiagnoser.Default);
Add(StatisticColumn.P80);
Add(StatisticColumn.P95);
Add(BaselineColumn.Default);
Add(RankColumn.Stars);
Add(BenchmarkLogicalGroupRule.ByJob);
}
}
private static readonly int[] Array;
static Bench()
{
Array = new int[1000];
var r = new Random();
for (var i = 0; i < Array.Length; i++)
{
Array[i] = r.Next(int.MaxValue / Array.Length) - 1;
}
}
[Benchmark]
public long ForEach()
{
var sum = 0L;
foreach (var i in Array)
{
sum += i;
}
return sum;
}
[Benchmark]
public long Aggregate()
{
return Array.Aggregate(0L, (current, i) => current + i);
}
[Benchmark(Baseline = true)]
public long For()
{
var sum = 0L;
for (var index = 0; index < Array.Length; index++)
{
sum += Array[index];
}
return sum;
}
[Benchmark]
public long ForReverse()
{
var sum = 0L;
for (var index = Array.Length - 1; index >= 0; index--)
{
sum += Array[index];
}
return sum;
}
[Benchmark]
public long ForLength()
{
var sum = 0L;
var length = Array.Length;
for (var index = 0; index < length; index++)
{
sum += Array[index];
}
return sum;
}
}
public static class Program
{
public static void Main()
{
BenchmarkRunner.Run<Bench>();
}
}
}
BenchmarkDotNet=v0.11.3, OS=Windows 10.0.17134.472 (1803/April2018Update/Redstone4)
Intel Core i7-8750H CPU 2.20GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=2.2.100
  [Host]        : .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT
  Clr LegacyJit : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0
  Clr RyuJit    : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0
  netcore2.0    : .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT
  netcore2.1    : .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT
  netcore2.2    : .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

Platform=X64  
Method Job Jit Runtime Toolchain Mean Error StdDev P80 P95 Ratio RatioSD Rank Baseline Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
ForEach Clr LegacyJit LegacyJit Clr Default 464.6 ns 1.2165 ns 1.0159 ns 465.2 ns 465.4 ns 0.89 0.00 * No - - - -
Aggregate Clr LegacyJit LegacyJit Clr Default 6,509.3 ns 14.6239 ns 12.2116 ns 6,517.2 ns 6,526.1 ns 12.40 0.03 ****** No - - - 32 B
For Clr LegacyJit LegacyJit Clr Default 525.8 ns 1.9842 ns 1.7590 ns 527.0 ns 528.8 ns 1.00 0.00 ** No - - - -
ForReverse Clr LegacyJit LegacyJit Clr Default 530.1 ns 1.5854 ns 1.4829 ns 531.2 ns 531.6 ns 1.01 0.00 ** No - - - -
ForLength Clr LegacyJit LegacyJit Clr Default 527.5 ns 3.4935 ns 3.2678 ns 530.5 ns 532.7 ns 1.00 0.01 ** No - - - -
ForEach Clr RyuJit RyuJit Clr Default 465.6 ns 3.1643 ns 2.9599 ns 469.2 ns 470.8 ns 0.89 0.01 * No - - - -
Aggregate Clr RyuJit RyuJit Clr Default 6,486.2 ns 9.1057 ns 7.1091 ns 6,491.6 ns 6,499.5 ns 12.35 0.02 ****** No - - - 32 B
For Clr RyuJit RyuJit Clr Default 525.1 ns 1.0212 ns 0.7973 ns 525.7 ns 526.4 ns 1.00 0.00 ** Yes - - - -
ForReverse Clr RyuJit RyuJit Clr Default 527.3 ns 2.8357 ns 2.6525 ns 529.3 ns 532.6 ns 1.00 0.00 ** No - - - -
ForLength Clr RyuJit RyuJit Clr Default 526.7 ns 1.5757 ns 1.3158 ns 527.4 ns 527.7 ns 1.00 0.00 ** No - - - -
ForEach netcore2.0 RyuJit Core .NET Core 2.0 527.6 ns 1.1819 ns 0.9227 ns 528.1 ns 528.9 ns 1.00 0.00 ** No - - - -
Aggregate netcore2.0 RyuJit Core .NET Core 2.0 5,728.2 ns 18.1853 ns 16.1208 ns 5,743.7 ns 5,754.9 ns 10.91 0.04 ***** No - - - 32 B
For netcore2.0 RyuJit Core .NET Core 2.0 530.1 ns 0.5558 ns 0.4339 ns 530.5 ns 530.7 ns 1.01 0.00 ** No - - - -
ForReverse netcore2.0 RyuJit Core .NET Core 2.0 529.5 ns 0.3014 ns 0.2517 ns 529.8 ns 529.8 ns 1.01 0.00 ** No - - - -
ForLength netcore2.0 RyuJit Core .NET Core 2.0 585.6 ns 7.2699 ns 6.8003 ns 593.6 ns 597.8 ns 1.11 0.01 *** No - - - -
ForEach netcore2.1 RyuJit Core .NET Core 2.1 470.7 ns 1.6964 ns 1.5868 ns 472.2 ns 472.8 ns 0.90 0.00 * No - - - -
Aggregate netcore2.1 RyuJit Core .NET Core 2.1 5,501.9 ns 30.4613 ns 28.4935 ns 5,519.8 ns 5,543.0 ns 10.47 0.07 **** No - - - 32 B
For netcore2.1 RyuJit Core .NET Core 2.1 535.1 ns 2.8728 ns 2.5467 ns 535.8 ns 540.6 ns 1.02 0.01 ** No - - - -
ForReverse netcore2.1 RyuJit Core .NET Core 2.1 532.1 ns 3.2626 ns 3.0519 ns 534.2 ns 537.9 ns 1.01 0.01 ** No - - - -
ForLength netcore2.1 RyuJit Core .NET Core 2.1 530.5 ns 2.3164 ns 2.0534 ns 531.9 ns 533.5 ns 1.01 0.00 ** No - - - -
ForEach netcore2.2 RyuJit Core .NET Core 2.2 470.8 ns 1.6300 ns 1.5247 ns 472.2 ns 472.8 ns 0.90 0.00 * No - - - -
Aggregate netcore2.2 RyuJit Core .NET Core 2.2 5,768.9 ns 13.4089 ns 11.1971 ns 5,774.7 ns 5,784.2 ns 10.99 0.03 ***** No - - - 32 B
For netcore2.2 RyuJit Core .NET Core 2.2 536.5 ns 2.5220 ns 2.3591 ns 539.1 ns 540.2 ns 1.02 0.01 ** No - - - -
ForReverse netcore2.2 RyuJit Core .NET Core 2.2 531.8 ns 3.0685 ns 2.8703 ns 533.8 ns 536.9 ns 1.01 0.01 ** No - - - -
ForLength netcore2.2 RyuJit Core .NET Core 2.2 532.1 ns 1.1017 ns 0.9766 ns 532.5 ns 532.8 ns 1.01 0.00 ** No - - - -

.NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

; ForEachLength.Bench.ForEach()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: stloc.1
       mov     rdx,1E510009968h
       mov     rdx,qword ptr [rdx]
       IL_0009: ldc.i4.0
       IL_000a: stloc.2
       IL_000b: br.s IL_001a
       xor     ecx,ecx
       IL_001a: ldloc.2
       IL_001b: ldloc.1
       IL_001c: ldlen
       IL_001d: conv.i4
       IL_001e: blt.s IL_000d
       mov     r8d,dword ptr [rdx+8]
       test    r8d,r8d
       jle     M00_L01
       IL_000d: ldloc.1
       IL_000e: ldloc.2
       IL_000f: ldelem.i4
       IL_0010: stloc.3
M00_L00:
       movsxd  r9,ecx
       mov     r9d,dword ptr [rdx+r9*4+10h]
       IL_0011: ldloc.0
       IL_0012: ldloc.3
       IL_0013: conv.i8
       IL_0014: add
       IL_0015: stloc.0
       movsxd  r9,r9d
       add     rax,r9
       IL_0016: ldloc.2
       IL_0017: ldc.i4.1
       IL_0018: add
       IL_0019: stloc.2
       inc     ecx
       cmp     r8d,ecx
       jg      M00_L00
       IL_0020: ldloc.0
       IL_0021: ret
M00_L01:
       ret
; Total bytes of code 48

.NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

; ForEachLength.Bench.Aggregate()
       IL_0000: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0005: ldc.i4.0
       IL_0006: conv.i8
       IL_0007: ldsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
       IL_000c: dup
       IL_000d: brtrue.s IL_0026
       IL_000f: pop
       IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
       IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
       IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
       mov     rcx,2D726CA9978h
       mov     r8,qword ptr [rcx]
       mov     rcx,2D726CA9968h
       mov     rsi,qword ptr [rcx]
       test    r8,r8
       jne     M00_L00
       mov     rcx,7FF8AAF880F8h
       call    clr+0x2540
       mov     rdi,rax
       mov     rdx,2D726CA9970h
       mov     rdx,qword ptr [rdx]
       test    rdx,rdx
       je      00007ff8`ab0c91bd
       lea     rcx,[rdi+8]
       call    clr+0x3ff0
       mov     rdx,7FF8AB0C7BE8h
       mov     qword ptr [rdi+18h],rdx
       IL_0020: dup
       IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
       IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
       IL_002b: ret
       mov     rcx,2D726CA9978h
       mov     rdx,rdi
       call    clr+0x3fc0
       mov     r8,rdi
M00_L00:
       mov     rcx,rsi
       xor     edx,edx
       mov     rax,7FF8AB0C5918h
; Total bytes of code 126
; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
       IL_0000: ldarg.1
       IL_0001: ldarg.2
       IL_0002: conv.i8
       IL_0003: add
       IL_0004: ret
       movsxd  rax,r8d
       add     rax,rdx
; Total bytes of code 6

.NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

; ForEachLength.Bench.For()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldc.i4.0
       IL_0004: stloc.1
       IL_0005: br.s IL_0016
       xor     edx,edx
       IL_0016: ldloc.1
       IL_0017: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_001c: ldlen
       IL_001d: conv.i4
       IL_001e: blt.s IL_0007
       mov     rcx,226CBB69968h
       mov     rcx,qword ptr [rcx]
       mov     r8d,dword ptr [rcx+8]
       test    r8d,r8d
       jle     M00_L01
       IL_0007: ldloc.0
       IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_000d: ldloc.1
       IL_000e: ldelem.i4
       IL_000f: conv.i8
       IL_0010: add
       IL_0011: stloc.0
M00_L00:
       mov     r9,rcx
       movsxd  r10,edx
       mov     r9d,dword ptr [r9+r10*4+10h]
       movsxd  r9,r9d
       add     rax,r9
       IL_0012: ldloc.1
       IL_0013: ldc.i4.1
       IL_0014: add
       IL_0015: stloc.1
       inc     edx
       cmp     r8d,edx
       jg      M00_L00
       IL_0020: ldloc.0
       IL_0021: ret
M00_L01:
       ret
; Total bytes of code 51

.NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

; ForEachLength.Bench.ForReverse()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: ldlen
       IL_0009: conv.i4
       IL_000a: ldc.i4.1
       IL_000b: sub
       IL_000c: stloc.1
       IL_000d: br.s IL_001e
       mov     rdx,1EB65BF9968h
       mov     rdx,qword ptr [rdx]
       mov     ecx,dword ptr [rdx+8]
       lea     r8d,[rcx-1]
       IL_001e: ldloc.1
       IL_001f: ldc.i4.0
       IL_0020: bge.s IL_000f
       test    r8d,r8d
       jl      M00_L01
       IL_000f: ldloc.0
       IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0015: ldloc.1
       IL_0016: ldelem.i4
       IL_0017: conv.i8
       IL_0018: add
       IL_0019: stloc.0
M00_L00:
       mov     r9,rdx
       cmp     r8d,ecx
       jae     00007ff8`ab0a90f2
       movsxd  r10,r8d
       mov     r9d,dword ptr [r9+r10*4+10h]
       movsxd  r9,r9d
       add     rax,r9
       IL_001a: ldloc.1
       IL_001b: ldc.i4.1
       IL_001c: sub
       IL_001d: stloc.1
       dec     r8d
       test    r8d,r8d
       jge     M00_L00
       IL_0022: ldloc.0
       IL_0023: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 61

.NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

; ForEachLength.Bench.ForLength()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: ldlen
       IL_0009: conv.i4
       IL_000a: stloc.1
       mov     rdx,22190009968h
       mov     rdx,qword ptr [rdx]
       mov     ecx,dword ptr [rdx+8]
       IL_000b: ldc.i4.0
       IL_000c: stloc.2
       IL_000d: br.s IL_001e
       xor     r8d,r8d
       IL_001e: ldloc.2
       IL_001f: ldloc.1
       IL_0020: blt.s IL_000f
       test    ecx,ecx
       jle     M00_L01
       IL_000f: ldloc.0
       IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0015: ldloc.2
       IL_0016: ldelem.i4
       IL_0017: conv.i8
       IL_0018: add
       IL_0019: stloc.0
M00_L00:
       mov     r9,rdx
       movsxd  r10,r8d
       mov     r9d,dword ptr [r9+r10*4+10h]
       movsxd  r9,r9d
       add     rax,r9
       IL_001a: ldloc.2
       IL_001b: ldc.i4.1
       IL_001c: add
       IL_001d: stloc.2
       inc     r8d
       cmp     r8d,ecx
       jl      M00_L00
       IL_0022: ldloc.0
       IL_0023: ret
M00_L01:
       ret
; Total bytes of code 51

.NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

; ForEachLength.Bench.ForEach()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: stloc.1
       mov     rdx,1BA48619968h
       mov     rdx,qword ptr [rdx]
       IL_0009: ldc.i4.0
       IL_000a: stloc.2
       IL_000b: br.s IL_001a
       xor     ecx,ecx
       IL_001a: ldloc.2
       IL_001b: ldloc.1
       IL_001c: ldlen
       IL_001d: conv.i4
       IL_001e: blt.s IL_000d
       mov     r8d,dword ptr [rdx+8]
       test    r8d,r8d
       jle     M00_L01
       IL_000d: ldloc.1
       IL_000e: ldloc.2
       IL_000f: ldelem.i4
       IL_0010: stloc.3
M00_L00:
       movsxd  r9,ecx
       mov     r9d,dword ptr [rdx+r9*4+10h]
       IL_0011: ldloc.0
       IL_0012: ldloc.3
       IL_0013: conv.i8
       IL_0014: add
       IL_0015: stloc.0
       movsxd  r9,r9d
       add     rax,r9
       IL_0016: ldloc.2
       IL_0017: ldc.i4.1
       IL_0018: add
       IL_0019: stloc.2
       inc     ecx
       cmp     r8d,ecx
       jg      M00_L00
       IL_0020: ldloc.0
       IL_0021: ret
M00_L01:
       ret
; Total bytes of code 48

.NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

; ForEachLength.Bench.Aggregate()
       IL_0000: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0005: ldc.i4.0
       IL_0006: conv.i8
       IL_0007: ldsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
       IL_000c: dup
       IL_000d: brtrue.s IL_0026
       IL_000f: pop
       IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
       IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
       IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
       mov     rcx,2661A669978h
       mov     r8,qword ptr [rcx]
       mov     rcx,2661A669968h
       mov     rsi,qword ptr [rcx]
       test    r8,r8
       jne     M00_L00
       mov     rcx,7FF8AAF780F8h
       call    clr+0x2540
       mov     rdi,rax
       mov     rdx,2661A669970h
       mov     rdx,qword ptr [rdx]
       test    rdx,rdx
       je      00007ff8`ab0b91bd
       lea     rcx,[rdi+8]
       call    clr+0x3ff0
       mov     rdx,7FF8AB0B7BE8h
       mov     qword ptr [rdi+18h],rdx
       IL_0020: dup
       IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
       IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
       IL_002b: ret
       mov     rcx,2661A669978h
       mov     rdx,rdi
       call    clr+0x3fc0
       mov     r8,rdi
M00_L00:
       mov     rcx,rsi
       xor     edx,edx
       mov     rax,7FF8AB0B5918h
; Total bytes of code 126
; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
       IL_0000: ldarg.1
       IL_0001: ldarg.2
       IL_0002: conv.i8
       IL_0003: add
       IL_0004: ret
       movsxd  rax,r8d
       add     rax,rdx
; Total bytes of code 6

.NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

; ForEachLength.Bench.For()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldc.i4.0
       IL_0004: stloc.1
       IL_0005: br.s IL_0016
       xor     edx,edx
       IL_0016: ldloc.1
       IL_0017: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_001c: ldlen
       IL_001d: conv.i4
       IL_001e: blt.s IL_0007
       mov     rcx,2A9C06A9968h
       mov     rcx,qword ptr [rcx]
       mov     r8d,dword ptr [rcx+8]
       test    r8d,r8d
       jle     M00_L01
       IL_0007: ldloc.0
       IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_000d: ldloc.1
       IL_000e: ldelem.i4
       IL_000f: conv.i8
       IL_0010: add
       IL_0011: stloc.0
M00_L00:
       mov     r9,rcx
       movsxd  r10,edx
       mov     r9d,dword ptr [r9+r10*4+10h]
       movsxd  r9,r9d
       add     rax,r9
       IL_0012: ldloc.1
       IL_0013: ldc.i4.1
       IL_0014: add
       IL_0015: stloc.1
       inc     edx
       cmp     r8d,edx
       jg      M00_L00
       IL_0020: ldloc.0
       IL_0021: ret
M00_L01:
       ret
; Total bytes of code 51

.NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

; ForEachLength.Bench.ForReverse()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: ldlen
       IL_0009: conv.i4
       IL_000a: ldc.i4.1
       IL_000b: sub
       IL_000c: stloc.1
       IL_000d: br.s IL_001e
       mov     rdx,1D8211D9968h
       mov     rdx,qword ptr [rdx]
       mov     ecx,dword ptr [rdx+8]
       lea     r8d,[rcx-1]
       IL_001e: ldloc.1
       IL_001f: ldc.i4.0
       IL_0020: bge.s IL_000f
       test    r8d,r8d
       jl      M00_L01
       IL_000f: ldloc.0
       IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0015: ldloc.1
       IL_0016: ldelem.i4
       IL_0017: conv.i8
       IL_0018: add
       IL_0019: stloc.0
M00_L00:
       mov     r9,rdx
       cmp     r8d,ecx
       jae     00007ff8`ab0b90f2
       movsxd  r10,r8d
       mov     r9d,dword ptr [r9+r10*4+10h]
       movsxd  r9,r9d
       add     rax,r9
       IL_001a: ldloc.1
       IL_001b: ldc.i4.1
       IL_001c: sub
       IL_001d: stloc.1
       dec     r8d
       test    r8d,r8d
       jge     M00_L00
       IL_0022: ldloc.0
       IL_0023: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 61

.NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

; ForEachLength.Bench.ForLength()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: ldlen
       IL_0009: conv.i4
       IL_000a: stloc.1
       mov     rdx,182662C9968h
       mov     rdx,qword ptr [rdx]
       mov     ecx,dword ptr [rdx+8]
       IL_000b: ldc.i4.0
       IL_000c: stloc.2
       IL_000d: br.s IL_001e
       xor     r8d,r8d
       IL_001e: ldloc.2
       IL_001f: ldloc.1
       IL_0020: blt.s IL_000f
       test    ecx,ecx
       jle     M00_L01
       IL_000f: ldloc.0
       IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0015: ldloc.2
       IL_0016: ldelem.i4
       IL_0017: conv.i8
       IL_0018: add
       IL_0019: stloc.0
M00_L00:
       mov     r9,rdx
       movsxd  r10,r8d
       mov     r9d,dword ptr [r9+r10*4+10h]
       movsxd  r9,r9d
       add     rax,r9
       IL_001a: ldloc.2
       IL_001b: ldc.i4.1
       IL_001c: add
       IL_001d: stloc.2
       inc     r8d
       cmp     r8d,ecx
       jl      M00_L00
       IL_0022: ldloc.0
       IL_0023: ret
M00_L01:
       ret
; Total bytes of code 51

.NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

; ForEachLength.Bench.ForEach()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: stloc.1
       mov     rdx,2A232917258h
       mov     rdx,qword ptr [rdx]
       IL_0009: ldc.i4.0
       IL_000a: stloc.2
       IL_000b: br.s IL_001a
       xor     ecx,ecx
       IL_001a: ldloc.2
       IL_001b: ldloc.1
       IL_001c: ldlen
       IL_001d: conv.i4
       IL_001e: blt.s IL_000d
       mov     r8d,dword ptr [rdx+8]
       test    r8d,r8d
       jle     M00_L01
       IL_000d: ldloc.1
       IL_000e: ldloc.2
       IL_000f: ldelem.i4
       IL_0010: stloc.3
M00_L00:
       movsxd  r9,ecx
       mov     r9d,dword ptr [rdx+r9*4+10h]
       IL_0011: ldloc.0
       IL_0012: ldloc.3
       IL_0013: conv.i8
       IL_0014: add
       IL_0015: stloc.0
       movsxd  r9,r9d
       add     rax,r9
       IL_0016: ldloc.2
       IL_0017: ldc.i4.1
       IL_0018: add
       IL_0019: stloc.2
       inc     ecx
       cmp     r8d,ecx
       jg      M00_L00
       IL_0020: ldloc.0
       IL_0021: ret
M00_L01:
       ret
; Total bytes of code 48

.NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

; ForEachLength.Bench.Aggregate()
       IL_0000: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0005: ldc.i4.0
       IL_0006: conv.i8
       IL_0007: ldsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
       IL_000c: dup
       IL_000d: brtrue.s IL_0026
       IL_000f: pop
       IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
       IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
       IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
       mov     rcx,1B2C64C7258h
       mov     rsi,qword ptr [rcx]
       mov     rcx,7FF810064470h
       mov     edx,4
       call    coreclr!MetaDataGetDispenser+0x37fa0
       mov     rcx,1B2C64C7268h
       mov     r8,qword ptr [rcx]
       test    r8,r8
       jne     M00_L00
       mov     rcx,7FF80FF7C898h
       call    coreclr!MetaDataGetDispenser+0x37ba0
       mov     rdi,rax
       mov     rdx,1B2C64C7260h
       mov     rdx,qword ptr [rdx]
       test    rdx,rdx
       je      00007ff8`0ffa3691
       lea     rcx,[rdi+8]
       call    coreclr!MetaDataGetDispenser+0x36700
       mov     rdx,7FF80FFA31F0h
       mov     qword ptr [rdi+18h],rdx
       IL_0020: dup
       IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
       IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
       IL_002b: ret
       mov     rcx,1B2C64C7268h
       mov     rdx,rdi
       call    coreclr!MetaDataGetDispenser+0x366d0
       mov     r8,rdi
M00_L00:
       mov     rcx,rsi
       xor     edx,edx
       mov     rax,7FF80FFA0A18h
; Total bytes of code 146
; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
       IL_0000: ldarg.1
       IL_0001: ldarg.2
       IL_0002: conv.i8
       IL_0003: add
       IL_0004: ret
       movsxd  rax,r8d
       add     rax,rdx
; Total bytes of code 6

.NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

; ForEachLength.Bench.For()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldc.i4.0
       IL_0004: stloc.1
       IL_0005: br.s IL_0016
       xor     edx,edx
       IL_0016: ldloc.1
       IL_0017: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_001c: ldlen
       IL_001d: conv.i4
       IL_001e: blt.s IL_0007
       mov     rcx,1B4D8EF7258h
       mov     rcx,qword ptr [rcx]
       cmp     dword ptr [rcx+8],0
       jle     M00_L01
       IL_0007: ldloc.0
       IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_000d: ldloc.1
       IL_000e: ldelem.i4
       IL_000f: conv.i8
       IL_0010: add
       IL_0011: stloc.0
M00_L00:
       mov     r8,rcx
       cmp     edx,dword ptr [r8+8]
       jae     00007ff8`0ff9321e
       movsxd  r9,edx
       mov     r8d,dword ptr [r8+r9*4+10h]
       movsxd  r8,r8d
       add     rax,r8
       IL_0012: ldloc.1
       IL_0013: ldc.i4.1
       IL_0014: add
       IL_0015: stloc.1
       inc     edx
       cmp     dword ptr [rcx+8],edx
       jg      M00_L00
       IL_0020: ldloc.0
       IL_0021: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 57

.NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

; ForEachLength.Bench.ForReverse()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: ldlen
       IL_0009: conv.i4
       IL_000a: ldc.i4.1
       IL_000b: sub
       IL_000c: stloc.1
       IL_000d: br.s IL_001e
       mov     rdx,22728847258h
       mov     rdx,qword ptr [rdx]
       mov     ecx,dword ptr [rdx+8]
       dec     ecx
       IL_001e: ldloc.1
       IL_001f: ldc.i4.0
       IL_0020: bge.s IL_000f
       test    ecx,ecx
       jl      M00_L01
       IL_000f: ldloc.0
       IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0015: ldloc.1
       IL_0016: ldelem.i4
       IL_0017: conv.i8
       IL_0018: add
       IL_0019: stloc.0
M00_L00:
       mov     r8,rdx
       cmp     ecx,dword ptr [r8+8]
       jae     00007ff8`0ffa321e
       movsxd  r9,ecx
       mov     r8d,dword ptr [r8+r9*4+10h]
       movsxd  r8,r8d
       add     rax,r8
       IL_001a: ldloc.1
       IL_001b: ldc.i4.1
       IL_001c: sub
       IL_001d: stloc.1
       dec     ecx
       test    ecx,ecx
       jge     M00_L00
       IL_0022: ldloc.0
       IL_0023: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 57

.NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

; ForEachLength.Bench.ForLength()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: ldlen
       IL_0009: conv.i4
       IL_000a: stloc.1
       mov     rdx,1743F7C7258h
       mov     rdx,qword ptr [rdx]
       mov     ecx,dword ptr [rdx+8]
       IL_000b: ldc.i4.0
       IL_000c: stloc.2
       IL_000d: br.s IL_001e
       xor     r8d,r8d
       IL_001e: ldloc.2
       IL_001f: ldloc.1
       IL_0020: blt.s IL_000f
       test    ecx,ecx
       jle     M00_L01
       IL_000f: ldloc.0
       IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0015: ldloc.2
       IL_0016: ldelem.i4
       IL_0017: conv.i8
       IL_0018: add
       IL_0019: stloc.0
M00_L00:
       mov     r9,rdx
       cmp     r8d,dword ptr [r9+8]
       jae     00007ff8`0ff73221
       movsxd  r10,r8d
       mov     r9d,dword ptr [r9+r10*4+10h]
       movsxd  r9,r9d
       add     rax,r9
       IL_001a: ldloc.2
       IL_001b: ldc.i4.1
       IL_001c: add
       IL_001d: stloc.2
       inc     r8d
       cmp     r8d,ecx
       jl      M00_L00
       IL_0022: ldloc.0
       IL_0023: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 60

.NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

; ForEachLength.Bench.ForEach()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: stloc.1
       mov     rdx,20DF1AD7250h
       mov     rdx,qword ptr [rdx]
       IL_0009: ldc.i4.0
       IL_000a: stloc.2
       IL_000b: br.s IL_001a
       xor     ecx,ecx
       IL_001a: ldloc.2
       IL_001b: ldloc.1
       IL_001c: ldlen
       IL_001d: conv.i4
       IL_001e: blt.s IL_000d
       mov     r8d,dword ptr [rdx+8]
       test    r8d,r8d
       jle     M00_L01
       IL_000d: ldloc.1
       IL_000e: ldloc.2
       IL_000f: ldelem.i4
       IL_0010: stloc.3
M00_L00:
       movsxd  r9,ecx
       mov     r9d,dword ptr [rdx+r9*4+10h]
       IL_0011: ldloc.0
       IL_0012: ldloc.3
       IL_0013: conv.i8
       IL_0014: add
       IL_0015: stloc.0
       movsxd  r9,r9d
       add     rax,r9
       IL_0016: ldloc.2
       IL_0017: ldc.i4.1
       IL_0018: add
       IL_0019: stloc.2
       inc     ecx
       cmp     r8d,ecx
       jg      M00_L00
       IL_0020: ldloc.0
       IL_0021: ret
M00_L01:
       ret
; Total bytes of code 48

.NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

; ForEachLength.Bench.Aggregate()
       IL_0000: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0005: ldc.i4.0
       IL_0006: conv.i8
       IL_0007: ldsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
       IL_000c: dup
       IL_000d: brtrue.s IL_0026
       IL_000f: pop
       IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
       IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
       IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
       mov     rcx,29593DA7250h
       mov     rsi,qword ptr [rcx]
       mov     rcx,7FF810043520h
       mov     edx,4
       call    coreclr!MetaDataGetDispenser+0x37fa0
       mov     rcx,29593DA7260h
       mov     r8,qword ptr [rcx]
       test    r8,r8
       jne     M00_L00
       mov     rcx,7FF80FF5C6D8h
       call    coreclr!MetaDataGetDispenser+0x37ba0
       mov     rdi,rax
       mov     rdx,29593DA7258h
       mov     rdx,qword ptr [rdx]
       test    rdx,rdx
       je      00007ff8`0ff834f1
       lea     rcx,[rdi+8]
       call    coreclr!MetaDataGetDispenser+0x36700
       mov     rdx,7FF80FF829C0h
       mov     qword ptr [rdi+18h],rdx
       IL_0020: dup
       IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
       IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
       IL_002b: ret
       mov     rcx,29593DA7260h
       mov     rdx,rdi
       call    coreclr!MetaDataGetDispenser+0x366d0
       mov     r8,rdi
M00_L00:
       mov     rcx,rsi
       xor     edx,edx
       mov     rax,7FF80FF829D0h
; Total bytes of code 146
; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
       IL_0000: ldarg.1
       IL_0001: ldarg.2
       IL_0002: conv.i8
       IL_0003: add
       IL_0004: ret
       movsxd  rax,r8d
       add     rax,rdx
; Total bytes of code 6

.NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

; ForEachLength.Bench.For()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldc.i4.0
       IL_0004: stloc.1
       IL_0005: br.s IL_0016
       xor     edx,edx
       IL_0016: ldloc.1
       IL_0017: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_001c: ldlen
       IL_001d: conv.i4
       IL_001e: blt.s IL_0007
       mov     rcx,211BBB87250h
       mov     rcx,qword ptr [rcx]
       cmp     dword ptr [rcx+8],0
       jle     M00_L01
       IL_0007: ldloc.0
       IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_000d: ldloc.1
       IL_000e: ldelem.i4
       IL_000f: conv.i8
       IL_0010: add
       IL_0011: stloc.0
M00_L00:
       mov     r8,rcx
       cmp     edx,dword ptr [r8+8]
       jae     00007ff8`0ff7348e
       movsxd  r9,edx
       mov     r8d,dword ptr [r8+r9*4+10h]
       movsxd  r8,r8d
       add     rax,r8
       IL_0012: ldloc.1
       IL_0013: ldc.i4.1
       IL_0014: add
       IL_0015: stloc.1
       inc     edx
       cmp     dword ptr [rcx+8],edx
       jg      M00_L00
       IL_0020: ldloc.0
       IL_0021: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 57

.NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

; ForEachLength.Bench.ForReverse()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: ldlen
       IL_0009: conv.i4
       IL_000a: ldc.i4.1
       IL_000b: sub
       IL_000c: stloc.1
       IL_000d: br.s IL_001e
       mov     rdx,1A5F3EF7250h
       mov     rdx,qword ptr [rdx]
       mov     ecx,dword ptr [rdx+8]
       dec     ecx
       IL_001e: ldloc.1
       IL_001f: ldc.i4.0
       IL_0020: bge.s IL_000f
       test    ecx,ecx
       jl      M00_L01
       IL_000f: ldloc.0
       IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0015: ldloc.1
       IL_0016: ldelem.i4
       IL_0017: conv.i8
       IL_0018: add
       IL_0019: stloc.0
M00_L00:
       mov     r8,rdx
       cmp     ecx,dword ptr [r8+8]
       jae     00007ff8`0ff8348e
       movsxd  r9,ecx
       mov     r8d,dword ptr [r8+r9*4+10h]
       movsxd  r8,r8d
       add     rax,r8
       IL_001a: ldloc.1
       IL_001b: ldc.i4.1
       IL_001c: sub
       IL_001d: stloc.1
       dec     ecx
       test    ecx,ecx
       jge     M00_L00
       IL_0022: ldloc.0
       IL_0023: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 57

.NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

; ForEachLength.Bench.ForLength()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: ldlen
       IL_0009: conv.i4
       IL_000a: stloc.1
       mov     rdx,1E910007250h
       mov     rdx,qword ptr [rdx]
       mov     ecx,dword ptr [rdx+8]
       IL_000b: ldc.i4.0
       IL_000c: stloc.2
       IL_000d: br.s IL_001e
       xor     r8d,r8d
       IL_001e: ldloc.2
       IL_001f: ldloc.1
       IL_0020: blt.s IL_000f
       test    ecx,ecx
       jle     M00_L01
       IL_000f: ldloc.0
       IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0015: ldloc.2
       IL_0016: ldelem.i4
       IL_0017: conv.i8
       IL_0018: add
       IL_0019: stloc.0
M00_L00:
       mov     r9,rdx
       cmp     r8d,dword ptr [r9+8]
       jae     00007ff8`0ff93491
       movsxd  r10,r8d
       mov     r9d,dword ptr [r9+r10*4+10h]
       movsxd  r9,r9d
       add     rax,r9
       IL_001a: ldloc.2
       IL_001b: ldc.i4.1
       IL_001c: add
       IL_001d: stloc.2
       inc     r8d
       cmp     r8d,ecx
       jl      M00_L00
       IL_0022: ldloc.0
       IL_0023: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 60

.NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

; ForEachLength.Bench.ForEach()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: stloc.1
       mov     rdx,12D52BB7250h
       mov     rdx,qword ptr [rdx]
       IL_0009: ldc.i4.0
       IL_000a: stloc.2
       IL_000b: br.s IL_001a
       xor     ecx,ecx
       IL_001a: ldloc.2
       IL_001b: ldloc.1
       IL_001c: ldlen
       IL_001d: conv.i4
       IL_001e: blt.s IL_000d
       mov     r8d,dword ptr [rdx+8]
       test    r8d,r8d
       jle     M00_L01
       IL_000d: ldloc.1
       IL_000e: ldloc.2
       IL_000f: ldelem.i4
       IL_0010: stloc.3
M00_L00:
       movsxd  r9,ecx
       mov     r9d,dword ptr [rdx+r9*4+10h]
       IL_0011: ldloc.0
       IL_0012: ldloc.3
       IL_0013: conv.i8
       IL_0014: add
       IL_0015: stloc.0
       movsxd  r9,r9d
       add     rax,r9
       IL_0016: ldloc.2
       IL_0017: ldc.i4.1
       IL_0018: add
       IL_0019: stloc.2
       inc     ecx
       cmp     r8d,ecx
       jg      M00_L00
       IL_0020: ldloc.0
       IL_0021: ret
M00_L01:
       ret
; Total bytes of code 48

.NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

; ForEachLength.Bench.Aggregate()
       IL_0000: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0005: ldc.i4.0
       IL_0006: conv.i8
       IL_0007: ldsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
       IL_000c: dup
       IL_000d: brtrue.s IL_0026
       IL_000f: pop
       IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
       IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
       IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
       mov     rcx,2B86D927250h
       mov     rsi,qword ptr [rcx]
       mov     rcx,7FF82BE54680h
       mov     edx,4
       call    coreclr!GC_Initialize+0x42b20
       mov     rcx,2B86D927260h
       mov     r8,qword ptr [rcx]
       test    r8,r8
       jne     M00_L00
       mov     rcx,7FF82BD6C908h
       call    coreclr!GC_Initialize+0x42720
       mov     rdi,rax
       mov     rdx,2B86D927258h
       mov     rdx,qword ptr [rdx]
       test    rdx,rdx
       je      00007ff8`2bd93571
       lea     rcx,[rdi+8]
       call    coreclr!GC_Initialize+0x41280
       mov     rdx,7FF82BD92A48h
       mov     qword ptr [rdi+18h],rdx
       IL_0020: dup
       IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
       IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
       IL_002b: ret
       mov     rcx,2B86D927260h
       mov     rdx,rdi
       call    coreclr!GC_Initialize+0x41250
       mov     r8,rdi
M00_L00:
       mov     rcx,rsi
       xor     edx,edx
       mov     rax,7FF82BD92A58h
; Total bytes of code 146
; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
       IL_0000: ldarg.1
       IL_0001: ldarg.2
       IL_0002: conv.i8
       IL_0003: add
       IL_0004: ret
       movsxd  rax,r8d
       add     rax,rdx
; Total bytes of code 6

.NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

; ForEachLength.Bench.For()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldc.i4.0
       IL_0004: stloc.1
       IL_0005: br.s IL_0016
       xor     edx,edx
       IL_0016: ldloc.1
       IL_0017: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_001c: ldlen
       IL_001d: conv.i4
       IL_001e: blt.s IL_0007
       mov     rcx,1E490007250h
       mov     rcx,qword ptr [rcx]
       cmp     dword ptr [rcx+8],0
       jle     M00_L01
       IL_0007: ldloc.0
       IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_000d: ldloc.1
       IL_000e: ldelem.i4
       IL_000f: conv.i8
       IL_0010: add
       IL_0011: stloc.0
M00_L00:
       mov     r8,rcx
       cmp     edx,dword ptr [r8+8]
       jae     00007ff8`2bd9350e
       movsxd  r9,edx
       mov     r8d,dword ptr [r8+r9*4+10h]
       movsxd  r8,r8d
       add     rax,r8
       IL_0012: ldloc.1
       IL_0013: ldc.i4.1
       IL_0014: add
       IL_0015: stloc.1
       inc     edx
       cmp     dword ptr [rcx+8],edx
       jg      M00_L00
       IL_0020: ldloc.0
       IL_0021: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 57

.NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

; ForEachLength.Bench.ForReverse()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: ldlen
       IL_0009: conv.i4
       IL_000a: ldc.i4.1
       IL_000b: sub
       IL_000c: stloc.1
       IL_000d: br.s IL_001e
       mov     rdx,1E3D7607250h
       mov     rdx,qword ptr [rdx]
       mov     ecx,dword ptr [rdx+8]
       dec     ecx
       IL_001e: ldloc.1
       IL_001f: ldc.i4.0
       IL_0020: bge.s IL_000f
       test    ecx,ecx
       jl      M00_L01
       IL_000f: ldloc.0
       IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0015: ldloc.1
       IL_0016: ldelem.i4
       IL_0017: conv.i8
       IL_0018: add
       IL_0019: stloc.0
M00_L00:
       mov     r8,rdx
       cmp     ecx,dword ptr [r8+8]
       jae     00007ff8`2bdb350e
       movsxd  r9,ecx
       mov     r8d,dword ptr [r8+r9*4+10h]
       movsxd  r8,r8d
       add     rax,r8
       IL_001a: ldloc.1
       IL_001b: ldc.i4.1
       IL_001c: sub
       IL_001d: stloc.1
       dec     ecx
       test    ecx,ecx
       jge     M00_L00
       IL_0022: ldloc.0
       IL_0023: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 57

.NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

; ForEachLength.Bench.ForLength()
       IL_0000: ldc.i4.0
       IL_0001: conv.i8
       IL_0002: stloc.0
       xor     eax,eax
       IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0008: ldlen
       IL_0009: conv.i4
       IL_000a: stloc.1
       mov     rdx,2ACBAB97250h
       mov     rdx,qword ptr [rdx]
       mov     ecx,dword ptr [rdx+8]
       IL_000b: ldc.i4.0
       IL_000c: stloc.2
       IL_000d: br.s IL_001e
       xor     r8d,r8d
       IL_001e: ldloc.2
       IL_001f: ldloc.1
       IL_0020: blt.s IL_000f
       test    ecx,ecx
       jle     M00_L01
       IL_000f: ldloc.0
       IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
       IL_0015: ldloc.2
       IL_0016: ldelem.i4
       IL_0017: conv.i8
       IL_0018: add
       IL_0019: stloc.0
M00_L00:
       mov     r9,rdx
       cmp     r8d,dword ptr [r9+8]
       jae     00007ff8`2bd73511
       movsxd  r10,r8d
       mov     r9d,dword ptr [r9+r10*4+10h]
       movsxd  r9,r9d
       add     rax,r9
       IL_001a: ldloc.2
       IL_001b: ldc.i4.1
       IL_001c: add
       IL_001d: stloc.2
       inc     r8d
       cmp     r8d,ecx
       jl      M00_L00
       IL_0022: ldloc.0
       IL_0023: ret
M00_L01:
       add     rsp,28h
; Total bytes of code 60

ForEachLength.Bench

Diff for ForEach method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

        xor     eax,eax
        IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0008: stloc.1
-       mov     rdx,1E510009968h
+       mov     rdx,1BA48619968h
        mov     rdx,qword ptr [rdx]
        IL_0009: ldc.i4.0
        IL_000a: stloc.2

Diff for ForEach method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        xor     eax,eax
        IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0008: stloc.1
-       mov     rdx,1E510009968h
+       mov     rdx,2A232917258h
        mov     rdx,qword ptr [rdx]
        IL_0009: ldc.i4.0
        IL_000a: stloc.2

Diff for ForEach method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        xor     eax,eax
        IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0008: stloc.1
-       mov     rdx,1E510009968h
+       mov     rdx,20DF1AD7250h
        mov     rdx,qword ptr [rdx]
        IL_0009: ldc.i4.0
        IL_000a: stloc.2

Diff for ForEach method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        xor     eax,eax
        IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0008: stloc.1
-       mov     rdx,1E510009968h
+       mov     rdx,12D52BB7250h
        mov     rdx,qword ptr [rdx]
        IL_0009: ldc.i4.0
        IL_000a: stloc.2

Diff for Aggregate method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

        IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
        IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
        IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
-       mov     rcx,2D726CA9978h
+       mov     rcx,2661A669978h
        mov     r8,qword ptr [rcx]
-       mov     rcx,2D726CA9968h
+       mov     rcx,2661A669968h
        mov     rsi,qword ptr [rcx]
        test    r8,r8
        jne     M00_L00
-       mov     rcx,7FF8AAF880F8h
+       mov     rcx,7FF8AAF780F8h
        call    clr+0x2540
        mov     rdi,rax
-       mov     rdx,2D726CA9970h
+       mov     rdx,2661A669970h
        mov     rdx,qword ptr [rdx]
        test    rdx,rdx
-       je      00007ff8`ab0c91bd
+       je      00007ff8`ab0b91bd
        lea     rcx,[rdi+8]
        call    clr+0x3ff0
-       mov     rdx,7FF8AB0C7BE8h
+       mov     rdx,7FF8AB0B7BE8h
        mov     qword ptr [rdi+18h],rdx
        IL_0020: dup
        IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
        IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
        IL_002b: ret
-       mov     rcx,2D726CA9978h
+       mov     rcx,2661A669978h
        mov     rdx,rdi
        call    clr+0x3fc0
        mov     r8,rdi
 M00_L00:
        mov     rcx,rsi
        xor     edx,edx
-       mov     rax,7FF8AB0C5918h
+       mov     rax,7FF8AB0B5918h
 ; Total bytes of code 126
 ; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
        IL_0000: ldarg.1

Diff for Aggregate method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
        IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
        IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
-       mov     rcx,2D726CA9978h
-       mov     r8,qword ptr [rcx]
-       mov     rcx,2D726CA9968h
+       mov     rcx,1B2C64C7258h
        mov     rsi,qword ptr [rcx]
+       mov     rcx,7FF810064470h
+       mov     edx,4
+       call    coreclr!MetaDataGetDispenser+0x37fa0
+       mov     rcx,1B2C64C7268h
+       mov     r8,qword ptr [rcx]
        test    r8,r8
        jne     M00_L00
-       mov     rcx,7FF8AAF880F8h
-       call    clr+0x2540
+       mov     rcx,7FF80FF7C898h
+       call    coreclr!MetaDataGetDispenser+0x37ba0
        mov     rdi,rax
-       mov     rdx,2D726CA9970h
+       mov     rdx,1B2C64C7260h
        mov     rdx,qword ptr [rdx]
        test    rdx,rdx
-       je      00007ff8`ab0c91bd
+       je      00007ff8`0ffa3691
        lea     rcx,[rdi+8]
-       call    clr+0x3ff0
-       mov     rdx,7FF8AB0C7BE8h
+       call    coreclr!MetaDataGetDispenser+0x36700
+       mov     rdx,7FF80FFA31F0h
        mov     qword ptr [rdi+18h],rdx
        IL_0020: dup
        IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
        IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
        IL_002b: ret
-       mov     rcx,2D726CA9978h
+       mov     rcx,1B2C64C7268h
        mov     rdx,rdi
-       call    clr+0x3fc0
+       call    coreclr!MetaDataGetDispenser+0x366d0
        mov     r8,rdi
 M00_L00:
        mov     rcx,rsi
        xor     edx,edx
-       mov     rax,7FF8AB0C5918h
-; Total bytes of code 126
+       mov     rax,7FF80FFA0A18h
+; Total bytes of code 146
 ; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
        IL_0000: ldarg.1
        IL_0001: ldarg.2

Diff for Aggregate method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
        IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
        IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
-       mov     rcx,2D726CA9978h
-       mov     r8,qword ptr [rcx]
-       mov     rcx,2D726CA9968h
+       mov     rcx,29593DA7250h
        mov     rsi,qword ptr [rcx]
+       mov     rcx,7FF810043520h
+       mov     edx,4
+       call    coreclr!MetaDataGetDispenser+0x37fa0
+       mov     rcx,29593DA7260h
+       mov     r8,qword ptr [rcx]
        test    r8,r8
        jne     M00_L00
-       mov     rcx,7FF8AAF880F8h
-       call    clr+0x2540
+       mov     rcx,7FF80FF5C6D8h
+       call    coreclr!MetaDataGetDispenser+0x37ba0
        mov     rdi,rax
-       mov     rdx,2D726CA9970h
+       mov     rdx,29593DA7258h
        mov     rdx,qword ptr [rdx]
        test    rdx,rdx
-       je      00007ff8`ab0c91bd
+       je      00007ff8`0ff834f1
        lea     rcx,[rdi+8]
-       call    clr+0x3ff0
-       mov     rdx,7FF8AB0C7BE8h
+       call    coreclr!MetaDataGetDispenser+0x36700
+       mov     rdx,7FF80FF829C0h
        mov     qword ptr [rdi+18h],rdx
        IL_0020: dup
        IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
        IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
        IL_002b: ret
-       mov     rcx,2D726CA9978h
+       mov     rcx,29593DA7260h
        mov     rdx,rdi
-       call    clr+0x3fc0
+       call    coreclr!MetaDataGetDispenser+0x366d0
        mov     r8,rdi
 M00_L00:
        mov     rcx,rsi
        xor     edx,edx
-       mov     rax,7FF8AB0C5918h
-; Total bytes of code 126
+       mov     rax,7FF80FF829D0h
+; Total bytes of code 146
 ; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
        IL_0000: ldarg.1
        IL_0001: ldarg.2

Diff for Aggregate method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
        IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
        IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
-       mov     rcx,2D726CA9978h
-       mov     r8,qword ptr [rcx]
-       mov     rcx,2D726CA9968h
+       mov     rcx,2B86D927250h
        mov     rsi,qword ptr [rcx]
+       mov     rcx,7FF82BE54680h
+       mov     edx,4
+       call    coreclr!GC_Initialize+0x42b20
+       mov     rcx,2B86D927260h
+       mov     r8,qword ptr [rcx]
        test    r8,r8
        jne     M00_L00
-       mov     rcx,7FF8AAF880F8h
-       call    clr+0x2540
+       mov     rcx,7FF82BD6C908h
+       call    coreclr!GC_Initialize+0x42720
        mov     rdi,rax
-       mov     rdx,2D726CA9970h
+       mov     rdx,2B86D927258h
        mov     rdx,qword ptr [rdx]
        test    rdx,rdx
-       je      00007ff8`ab0c91bd
+       je      00007ff8`2bd93571
        lea     rcx,[rdi+8]
-       call    clr+0x3ff0
-       mov     rdx,7FF8AB0C7BE8h
+       call    coreclr!GC_Initialize+0x41280
+       mov     rdx,7FF82BD92A48h
        mov     qword ptr [rdi+18h],rdx
        IL_0020: dup
        IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
        IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
        IL_002b: ret
-       mov     rcx,2D726CA9978h
+       mov     rcx,2B86D927260h
        mov     rdx,rdi
-       call    clr+0x3fc0
+       call    coreclr!GC_Initialize+0x41250
        mov     r8,rdi
 M00_L00:
        mov     rcx,rsi
        xor     edx,edx
-       mov     rax,7FF8AB0C5918h
-; Total bytes of code 126
+       mov     rax,7FF82BD92A58h
+; Total bytes of code 146
 ; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
        IL_0000: ldarg.1
        IL_0001: ldarg.2

Diff for For method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

        IL_001c: ldlen
        IL_001d: conv.i4
        IL_001e: blt.s IL_0007
-       mov     rcx,226CBB69968h
+       mov     rcx,2A9C06A9968h
        mov     rcx,qword ptr [rcx]
        mov     r8d,dword ptr [rcx+8]
        test    r8d,r8d

Diff for For method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_001c: ldlen
        IL_001d: conv.i4
        IL_001e: blt.s IL_0007
-       mov     rcx,226CBB69968h
+       mov     rcx,1B4D8EF7258h
        mov     rcx,qword ptr [rcx]
-       mov     r8d,dword ptr [rcx+8]
-       test    r8d,r8d
+       cmp     dword ptr [rcx+8],0
        jle     M00_L01
        IL_0007: ldloc.0
        IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0010: add
        IL_0011: stloc.0
 M00_L00:
-       mov     r9,rcx
-       movsxd  r10,edx
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rcx
+       cmp     edx,dword ptr [r8+8]
+       jae     00007ff8`0ff9321e
+       movsxd  r9,edx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_0012: ldloc.1
        IL_0013: ldc.i4.1
        IL_0014: add
        IL_0015: stloc.1
        inc     edx
-       cmp     r8d,edx
+       cmp     dword ptr [rcx+8],edx
        jg      M00_L00
        IL_0020: ldloc.0
        IL_0021: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 57
 

Diff for For method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_001c: ldlen
        IL_001d: conv.i4
        IL_001e: blt.s IL_0007
-       mov     rcx,226CBB69968h
+       mov     rcx,211BBB87250h
        mov     rcx,qword ptr [rcx]
-       mov     r8d,dword ptr [rcx+8]
-       test    r8d,r8d
+       cmp     dword ptr [rcx+8],0
        jle     M00_L01
        IL_0007: ldloc.0
        IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0010: add
        IL_0011: stloc.0
 M00_L00:
-       mov     r9,rcx
-       movsxd  r10,edx
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rcx
+       cmp     edx,dword ptr [r8+8]
+       jae     00007ff8`0ff7348e
+       movsxd  r9,edx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_0012: ldloc.1
        IL_0013: ldc.i4.1
        IL_0014: add
        IL_0015: stloc.1
        inc     edx
-       cmp     r8d,edx
+       cmp     dword ptr [rcx+8],edx
        jg      M00_L00
        IL_0020: ldloc.0
        IL_0021: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 57
 

Diff for For method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_001c: ldlen
        IL_001d: conv.i4
        IL_001e: blt.s IL_0007
-       mov     rcx,226CBB69968h
+       mov     rcx,1E490007250h
        mov     rcx,qword ptr [rcx]
-       mov     r8d,dword ptr [rcx+8]
-       test    r8d,r8d
+       cmp     dword ptr [rcx+8],0
        jle     M00_L01
        IL_0007: ldloc.0
        IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0010: add
        IL_0011: stloc.0
 M00_L00:
-       mov     r9,rcx
-       movsxd  r10,edx
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rcx
+       cmp     edx,dword ptr [r8+8]
+       jae     00007ff8`2bd9350e
+       movsxd  r9,edx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_0012: ldloc.1
        IL_0013: ldc.i4.1
        IL_0014: add
        IL_0015: stloc.1
        inc     edx
-       cmp     r8d,edx
+       cmp     dword ptr [rcx+8],edx
        jg      M00_L00
        IL_0020: ldloc.0
        IL_0021: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 57
 

Diff for ForReverse method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

        IL_000b: sub
        IL_000c: stloc.1
        IL_000d: br.s IL_001e
-       mov     rdx,1EB65BF9968h
+       mov     rdx,1D8211D9968h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        lea     r8d,[rcx-1]
 M00_L00:
        mov     r9,rdx
        cmp     r8d,ecx
-       jae     00007ff8`ab0a90f2
+       jae     00007ff8`ab0b90f2
        movsxd  r10,r8d
        mov     r9d,dword ptr [r9+r10*4+10h]
        movsxd  r9,r9d

Diff for ForReverse method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_000b: sub
        IL_000c: stloc.1
        IL_000d: br.s IL_001e
-       mov     rdx,1EB65BF9968h
+       mov     rdx,22728847258h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
-       lea     r8d,[rcx-1]
+       dec     ecx
        IL_001e: ldloc.1
        IL_001f: ldc.i4.0
        IL_0020: bge.s IL_000f
-       test    r8d,r8d
+       test    ecx,ecx
        jl      M00_L01
        IL_000f: ldloc.0
        IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0018: add
        IL_0019: stloc.0
 M00_L00:
-       mov     r9,rdx
-       cmp     r8d,ecx
-       jae     00007ff8`ab0a90f2
-       movsxd  r10,r8d
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rdx
+       cmp     ecx,dword ptr [r8+8]
+       jae     00007ff8`0ffa321e
+       movsxd  r9,ecx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_001a: ldloc.1
        IL_001b: ldc.i4.1
        IL_001c: sub
        IL_001d: stloc.1
-       dec     r8d
-       test    r8d,r8d
+       dec     ecx
+       test    ecx,ecx
        jge     M00_L00
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
        add     rsp,28h
-; Total bytes of code 61
+; Total bytes of code 57
 

Diff for ForReverse method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_000b: sub
        IL_000c: stloc.1
        IL_000d: br.s IL_001e
-       mov     rdx,1EB65BF9968h
+       mov     rdx,1A5F3EF7250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
-       lea     r8d,[rcx-1]
+       dec     ecx
        IL_001e: ldloc.1
        IL_001f: ldc.i4.0
        IL_0020: bge.s IL_000f
-       test    r8d,r8d
+       test    ecx,ecx
        jl      M00_L01
        IL_000f: ldloc.0
        IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0018: add
        IL_0019: stloc.0
 M00_L00:
-       mov     r9,rdx
-       cmp     r8d,ecx
-       jae     00007ff8`ab0a90f2
-       movsxd  r10,r8d
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rdx
+       cmp     ecx,dword ptr [r8+8]
+       jae     00007ff8`0ff8348e
+       movsxd  r9,ecx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_001a: ldloc.1
        IL_001b: ldc.i4.1
        IL_001c: sub
        IL_001d: stloc.1
-       dec     r8d
-       test    r8d,r8d
+       dec     ecx
+       test    ecx,ecx
        jge     M00_L00
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
        add     rsp,28h
-; Total bytes of code 61
+; Total bytes of code 57
 

Diff for ForReverse method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_000b: sub
        IL_000c: stloc.1
        IL_000d: br.s IL_001e
-       mov     rdx,1EB65BF9968h
+       mov     rdx,1E3D7607250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
-       lea     r8d,[rcx-1]
+       dec     ecx
        IL_001e: ldloc.1
        IL_001f: ldc.i4.0
        IL_0020: bge.s IL_000f
-       test    r8d,r8d
+       test    ecx,ecx
        jl      M00_L01
        IL_000f: ldloc.0
        IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0018: add
        IL_0019: stloc.0
 M00_L00:
-       mov     r9,rdx
-       cmp     r8d,ecx
-       jae     00007ff8`ab0a90f2
-       movsxd  r10,r8d
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rdx
+       cmp     ecx,dword ptr [r8+8]
+       jae     00007ff8`2bdb350e
+       movsxd  r9,ecx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_001a: ldloc.1
        IL_001b: ldc.i4.1
        IL_001c: sub
        IL_001d: stloc.1
-       dec     r8d
-       test    r8d,r8d
+       dec     ecx
+       test    ecx,ecx
        jge     M00_L00
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
        add     rsp,28h
-; Total bytes of code 61
+; Total bytes of code 57
 

Diff for ForLength method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0

        IL_0008: ldlen
        IL_0009: conv.i4
        IL_000a: stloc.1
-       mov     rdx,22190009968h
+       mov     rdx,182662C9968h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        IL_000b: ldc.i4.0

Diff for ForLength method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_0008: ldlen
        IL_0009: conv.i4
        IL_000a: stloc.1
-       mov     rdx,22190009968h
+       mov     rdx,1743F7C7258h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        IL_000b: ldc.i4.0
        IL_0019: stloc.0
 M00_L00:
        mov     r9,rdx
+       cmp     r8d,dword ptr [r9+8]
+       jae     00007ff8`0ff73221
        movsxd  r10,r8d
        mov     r9d,dword ptr [r9+r10*4+10h]
        movsxd  r9,r9d
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 60
 

Diff for ForLength method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_0008: ldlen
        IL_0009: conv.i4
        IL_000a: stloc.1
-       mov     rdx,22190009968h
+       mov     rdx,1E910007250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        IL_000b: ldc.i4.0
        IL_0019: stloc.0
 M00_L00:
        mov     r9,rdx
+       cmp     r8d,dword ptr [r9+8]
+       jae     00007ff8`0ff93491
        movsxd  r10,r8d
        mov     r9d,dword ptr [r9+r10*4+10h]
        movsxd  r9,r9d
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 60
 

Diff for ForLength method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_0008: ldlen
        IL_0009: conv.i4
        IL_000a: stloc.1
-       mov     rdx,22190009968h
+       mov     rdx,2ACBAB97250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        IL_000b: ldc.i4.0
        IL_0019: stloc.0
 M00_L00:
        mov     r9,rdx
+       cmp     r8d,dword ptr [r9+8]
+       jae     00007ff8`2bd73511
        movsxd  r10,r8d
        mov     r9d,dword ptr [r9+r10*4+10h]
        movsxd  r9,r9d
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 60
 

Diff for ForEach method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        xor     eax,eax
        IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0008: stloc.1
-       mov     rdx,1BA48619968h
+       mov     rdx,2A232917258h
        mov     rdx,qword ptr [rdx]
        IL_0009: ldc.i4.0
        IL_000a: stloc.2

Diff for ForEach method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        xor     eax,eax
        IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0008: stloc.1
-       mov     rdx,1BA48619968h
+       mov     rdx,20DF1AD7250h
        mov     rdx,qword ptr [rdx]
        IL_0009: ldc.i4.0
        IL_000a: stloc.2

Diff for ForEach method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        xor     eax,eax
        IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0008: stloc.1
-       mov     rdx,1BA48619968h
+       mov     rdx,12D52BB7250h
        mov     rdx,qword ptr [rdx]
        IL_0009: ldc.i4.0
        IL_000a: stloc.2

Diff for Aggregate method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
        IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
        IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
-       mov     rcx,2661A669978h
-       mov     r8,qword ptr [rcx]
-       mov     rcx,2661A669968h
+       mov     rcx,1B2C64C7258h
        mov     rsi,qword ptr [rcx]
+       mov     rcx,7FF810064470h
+       mov     edx,4
+       call    coreclr!MetaDataGetDispenser+0x37fa0
+       mov     rcx,1B2C64C7268h
+       mov     r8,qword ptr [rcx]
        test    r8,r8
        jne     M00_L00
-       mov     rcx,7FF8AAF780F8h
-       call    clr+0x2540
+       mov     rcx,7FF80FF7C898h
+       call    coreclr!MetaDataGetDispenser+0x37ba0
        mov     rdi,rax
-       mov     rdx,2661A669970h
+       mov     rdx,1B2C64C7260h
        mov     rdx,qword ptr [rdx]
        test    rdx,rdx
-       je      00007ff8`ab0b91bd
+       je      00007ff8`0ffa3691
        lea     rcx,[rdi+8]
-       call    clr+0x3ff0
-       mov     rdx,7FF8AB0B7BE8h
+       call    coreclr!MetaDataGetDispenser+0x36700
+       mov     rdx,7FF80FFA31F0h
        mov     qword ptr [rdi+18h],rdx
        IL_0020: dup
        IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
        IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
        IL_002b: ret
-       mov     rcx,2661A669978h
+       mov     rcx,1B2C64C7268h
        mov     rdx,rdi
-       call    clr+0x3fc0
+       call    coreclr!MetaDataGetDispenser+0x366d0
        mov     r8,rdi
 M00_L00:
        mov     rcx,rsi
        xor     edx,edx
-       mov     rax,7FF8AB0B5918h
-; Total bytes of code 126
+       mov     rax,7FF80FFA0A18h
+; Total bytes of code 146
 ; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
        IL_0000: ldarg.1
        IL_0001: ldarg.2

Diff for Aggregate method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
        IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
        IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
-       mov     rcx,2661A669978h
-       mov     r8,qword ptr [rcx]
-       mov     rcx,2661A669968h
+       mov     rcx,29593DA7250h
        mov     rsi,qword ptr [rcx]
+       mov     rcx,7FF810043520h
+       mov     edx,4
+       call    coreclr!MetaDataGetDispenser+0x37fa0
+       mov     rcx,29593DA7260h
+       mov     r8,qword ptr [rcx]
        test    r8,r8
        jne     M00_L00
-       mov     rcx,7FF8AAF780F8h
-       call    clr+0x2540
+       mov     rcx,7FF80FF5C6D8h
+       call    coreclr!MetaDataGetDispenser+0x37ba0
        mov     rdi,rax
-       mov     rdx,2661A669970h
+       mov     rdx,29593DA7258h
        mov     rdx,qword ptr [rdx]
        test    rdx,rdx
-       je      00007ff8`ab0b91bd
+       je      00007ff8`0ff834f1
        lea     rcx,[rdi+8]
-       call    clr+0x3ff0
-       mov     rdx,7FF8AB0B7BE8h
+       call    coreclr!MetaDataGetDispenser+0x36700
+       mov     rdx,7FF80FF829C0h
        mov     qword ptr [rdi+18h],rdx
        IL_0020: dup
        IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
        IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
        IL_002b: ret
-       mov     rcx,2661A669978h
+       mov     rcx,29593DA7260h
        mov     rdx,rdi
-       call    clr+0x3fc0
+       call    coreclr!MetaDataGetDispenser+0x366d0
        mov     r8,rdi
 M00_L00:
        mov     rcx,rsi
        xor     edx,edx
-       mov     rax,7FF8AB0B5918h
-; Total bytes of code 126
+       mov     rax,7FF80FF829D0h
+; Total bytes of code 146
 ; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
        IL_0000: ldarg.1
        IL_0001: ldarg.2

Diff for Aggregate method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
        IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
        IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
-       mov     rcx,2661A669978h
-       mov     r8,qword ptr [rcx]
-       mov     rcx,2661A669968h
+       mov     rcx,2B86D927250h
        mov     rsi,qword ptr [rcx]
+       mov     rcx,7FF82BE54680h
+       mov     edx,4
+       call    coreclr!GC_Initialize+0x42b20
+       mov     rcx,2B86D927260h
+       mov     r8,qword ptr [rcx]
        test    r8,r8
        jne     M00_L00
-       mov     rcx,7FF8AAF780F8h
-       call    clr+0x2540
+       mov     rcx,7FF82BD6C908h
+       call    coreclr!GC_Initialize+0x42720
        mov     rdi,rax
-       mov     rdx,2661A669970h
+       mov     rdx,2B86D927258h
        mov     rdx,qword ptr [rdx]
        test    rdx,rdx
-       je      00007ff8`ab0b91bd
+       je      00007ff8`2bd93571
        lea     rcx,[rdi+8]
-       call    clr+0x3ff0
-       mov     rdx,7FF8AB0B7BE8h
+       call    coreclr!GC_Initialize+0x41280
+       mov     rdx,7FF82BD92A48h
        mov     qword ptr [rdi+18h],rdx
        IL_0020: dup
        IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
        IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
        IL_002b: ret
-       mov     rcx,2661A669978h
+       mov     rcx,2B86D927260h
        mov     rdx,rdi
-       call    clr+0x3fc0
+       call    coreclr!GC_Initialize+0x41250
        mov     r8,rdi
 M00_L00:
        mov     rcx,rsi
        xor     edx,edx
-       mov     rax,7FF8AB0B5918h
-; Total bytes of code 126
+       mov     rax,7FF82BD92A58h
+; Total bytes of code 146
 ; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
        IL_0000: ldarg.1
        IL_0001: ldarg.2

Diff for For method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_001c: ldlen
        IL_001d: conv.i4
        IL_001e: blt.s IL_0007
-       mov     rcx,2A9C06A9968h
+       mov     rcx,1B4D8EF7258h
        mov     rcx,qword ptr [rcx]
-       mov     r8d,dword ptr [rcx+8]
-       test    r8d,r8d
+       cmp     dword ptr [rcx+8],0
        jle     M00_L01
        IL_0007: ldloc.0
        IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0010: add
        IL_0011: stloc.0
 M00_L00:
-       mov     r9,rcx
-       movsxd  r10,edx
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rcx
+       cmp     edx,dword ptr [r8+8]
+       jae     00007ff8`0ff9321e
+       movsxd  r9,edx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_0012: ldloc.1
        IL_0013: ldc.i4.1
        IL_0014: add
        IL_0015: stloc.1
        inc     edx
-       cmp     r8d,edx
+       cmp     dword ptr [rcx+8],edx
        jg      M00_L00
        IL_0020: ldloc.0
        IL_0021: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 57
 

Diff for For method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_001c: ldlen
        IL_001d: conv.i4
        IL_001e: blt.s IL_0007
-       mov     rcx,2A9C06A9968h
+       mov     rcx,211BBB87250h
        mov     rcx,qword ptr [rcx]
-       mov     r8d,dword ptr [rcx+8]
-       test    r8d,r8d
+       cmp     dword ptr [rcx+8],0
        jle     M00_L01
        IL_0007: ldloc.0
        IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0010: add
        IL_0011: stloc.0
 M00_L00:
-       mov     r9,rcx
-       movsxd  r10,edx
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rcx
+       cmp     edx,dword ptr [r8+8]
+       jae     00007ff8`0ff7348e
+       movsxd  r9,edx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_0012: ldloc.1
        IL_0013: ldc.i4.1
        IL_0014: add
        IL_0015: stloc.1
        inc     edx
-       cmp     r8d,edx
+       cmp     dword ptr [rcx+8],edx
        jg      M00_L00
        IL_0020: ldloc.0
        IL_0021: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 57
 

Diff for For method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_001c: ldlen
        IL_001d: conv.i4
        IL_001e: blt.s IL_0007
-       mov     rcx,2A9C06A9968h
+       mov     rcx,1E490007250h
        mov     rcx,qword ptr [rcx]
-       mov     r8d,dword ptr [rcx+8]
-       test    r8d,r8d
+       cmp     dword ptr [rcx+8],0
        jle     M00_L01
        IL_0007: ldloc.0
        IL_0008: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0010: add
        IL_0011: stloc.0
 M00_L00:
-       mov     r9,rcx
-       movsxd  r10,edx
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rcx
+       cmp     edx,dword ptr [r8+8]
+       jae     00007ff8`2bd9350e
+       movsxd  r9,edx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_0012: ldloc.1
        IL_0013: ldc.i4.1
        IL_0014: add
        IL_0015: stloc.1
        inc     edx
-       cmp     r8d,edx
+       cmp     dword ptr [rcx+8],edx
        jg      M00_L00
        IL_0020: ldloc.0
        IL_0021: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 57
 

Diff for ForReverse method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_000b: sub
        IL_000c: stloc.1
        IL_000d: br.s IL_001e
-       mov     rdx,1D8211D9968h
+       mov     rdx,22728847258h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
-       lea     r8d,[rcx-1]
+       dec     ecx
        IL_001e: ldloc.1
        IL_001f: ldc.i4.0
        IL_0020: bge.s IL_000f
-       test    r8d,r8d
+       test    ecx,ecx
        jl      M00_L01
        IL_000f: ldloc.0
        IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0018: add
        IL_0019: stloc.0
 M00_L00:
-       mov     r9,rdx
-       cmp     r8d,ecx
-       jae     00007ff8`ab0b90f2
-       movsxd  r10,r8d
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rdx
+       cmp     ecx,dword ptr [r8+8]
+       jae     00007ff8`0ffa321e
+       movsxd  r9,ecx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_001a: ldloc.1
        IL_001b: ldc.i4.1
        IL_001c: sub
        IL_001d: stloc.1
-       dec     r8d
-       test    r8d,r8d
+       dec     ecx
+       test    ecx,ecx
        jge     M00_L00
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
        add     rsp,28h
-; Total bytes of code 61
+; Total bytes of code 57
 

Diff for ForReverse method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_000b: sub
        IL_000c: stloc.1
        IL_000d: br.s IL_001e
-       mov     rdx,1D8211D9968h
+       mov     rdx,1A5F3EF7250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
-       lea     r8d,[rcx-1]
+       dec     ecx
        IL_001e: ldloc.1
        IL_001f: ldc.i4.0
        IL_0020: bge.s IL_000f
-       test    r8d,r8d
+       test    ecx,ecx
        jl      M00_L01
        IL_000f: ldloc.0
        IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0018: add
        IL_0019: stloc.0
 M00_L00:
-       mov     r9,rdx
-       cmp     r8d,ecx
-       jae     00007ff8`ab0b90f2
-       movsxd  r10,r8d
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rdx
+       cmp     ecx,dword ptr [r8+8]
+       jae     00007ff8`0ff8348e
+       movsxd  r9,ecx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_001a: ldloc.1
        IL_001b: ldc.i4.1
        IL_001c: sub
        IL_001d: stloc.1
-       dec     r8d
-       test    r8d,r8d
+       dec     ecx
+       test    ecx,ecx
        jge     M00_L00
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
        add     rsp,28h
-; Total bytes of code 61
+; Total bytes of code 57
 

Diff for ForReverse method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_000b: sub
        IL_000c: stloc.1
        IL_000d: br.s IL_001e
-       mov     rdx,1D8211D9968h
+       mov     rdx,1E3D7607250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
-       lea     r8d,[rcx-1]
+       dec     ecx
        IL_001e: ldloc.1
        IL_001f: ldc.i4.0
        IL_0020: bge.s IL_000f
-       test    r8d,r8d
+       test    ecx,ecx
        jl      M00_L01
        IL_000f: ldloc.0
        IL_0010: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0018: add
        IL_0019: stloc.0
 M00_L00:
-       mov     r9,rdx
-       cmp     r8d,ecx
-       jae     00007ff8`ab0b90f2
-       movsxd  r10,r8d
-       mov     r9d,dword ptr [r9+r10*4+10h]
-       movsxd  r9,r9d
-       add     rax,r9
+       mov     r8,rdx
+       cmp     ecx,dword ptr [r8+8]
+       jae     00007ff8`2bdb350e
+       movsxd  r9,ecx
+       mov     r8d,dword ptr [r8+r9*4+10h]
+       movsxd  r8,r8d
+       add     rax,r8
        IL_001a: ldloc.1
        IL_001b: ldc.i4.1
        IL_001c: sub
        IL_001d: stloc.1
-       dec     r8d
-       test    r8d,r8d
+       dec     ecx
+       test    ecx,ecx
        jge     M00_L00
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
        add     rsp,28h
-; Total bytes of code 61
+; Total bytes of code 57
 

Diff for ForLength method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_0008: ldlen
        IL_0009: conv.i4
        IL_000a: stloc.1
-       mov     rdx,182662C9968h
+       mov     rdx,1743F7C7258h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        IL_000b: ldc.i4.0
        IL_0019: stloc.0
 M00_L00:
        mov     r9,rdx
+       cmp     r8d,dword ptr [r9+8]
+       jae     00007ff8`0ff73221
        movsxd  r10,r8d
        mov     r9d,dword ptr [r9+r10*4+10h]
        movsxd  r9,r9d
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 60
 

Diff for ForLength method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_0008: ldlen
        IL_0009: conv.i4
        IL_000a: stloc.1
-       mov     rdx,182662C9968h
+       mov     rdx,1E910007250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        IL_000b: ldc.i4.0
        IL_0019: stloc.0
 M00_L00:
        mov     r9,rdx
+       cmp     r8d,dword ptr [r9+8]
+       jae     00007ff8`0ff93491
        movsxd  r10,r8d
        mov     r9d,dword ptr [r9+r10*4+10h]
        movsxd  r9,r9d
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 60
 

Diff for ForLength method between: .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0 .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_0008: ldlen
        IL_0009: conv.i4
        IL_000a: stloc.1
-       mov     rdx,182662C9968h
+       mov     rdx,2ACBAB97250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        IL_000b: ldc.i4.0
        IL_0019: stloc.0
 M00_L00:
        mov     r9,rdx
+       cmp     r8d,dword ptr [r9+8]
+       jae     00007ff8`2bd73511
        movsxd  r10,r8d
        mov     r9d,dword ptr [r9+r10*4+10h]
        movsxd  r9,r9d
        IL_0022: ldloc.0
        IL_0023: ret
 M00_L01:
-       ret
-; Total bytes of code 51
+       add     rsp,28h
+; Total bytes of code 60
 

Diff for ForEach method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        xor     eax,eax
        IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0008: stloc.1
-       mov     rdx,2A232917258h
+       mov     rdx,20DF1AD7250h
        mov     rdx,qword ptr [rdx]
        IL_0009: ldc.i4.0
        IL_000a: stloc.2

Diff for ForEach method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        xor     eax,eax
        IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0008: stloc.1
-       mov     rdx,2A232917258h
+       mov     rdx,12D52BB7250h
        mov     rdx,qword ptr [rdx]
        IL_0009: ldc.i4.0
        IL_000a: stloc.2

Diff for Aggregate method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
        IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
        IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
-       mov     rcx,1B2C64C7258h
+       mov     rcx,29593DA7250h
        mov     rsi,qword ptr [rcx]
-       mov     rcx,7FF810064470h
+       mov     rcx,7FF810043520h
        mov     edx,4
        call    coreclr!MetaDataGetDispenser+0x37fa0
-       mov     rcx,1B2C64C7268h
+       mov     rcx,29593DA7260h
        mov     r8,qword ptr [rcx]
        test    r8,r8
        jne     M00_L00
-       mov     rcx,7FF80FF7C898h
+       mov     rcx,7FF80FF5C6D8h
        call    coreclr!MetaDataGetDispenser+0x37ba0
        mov     rdi,rax
-       mov     rdx,1B2C64C7260h
+       mov     rdx,29593DA7258h
        mov     rdx,qword ptr [rdx]
        test    rdx,rdx
-       je      00007ff8`0ffa3691
+       je      00007ff8`0ff834f1
        lea     rcx,[rdi+8]
        call    coreclr!MetaDataGetDispenser+0x36700
-       mov     rdx,7FF80FFA31F0h
+       mov     rdx,7FF80FF829C0h
        mov     qword ptr [rdi+18h],rdx
        IL_0020: dup
        IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
        IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
        IL_002b: ret
-       mov     rcx,1B2C64C7268h
+       mov     rcx,29593DA7260h
        mov     rdx,rdi
        call    coreclr!MetaDataGetDispenser+0x366d0
        mov     r8,rdi
 M00_L00:
        mov     rcx,rsi
        xor     edx,edx
-       mov     rax,7FF80FFA0A18h
+       mov     rax,7FF80FF829D0h
 ; Total bytes of code 146
 ; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
        IL_0000: ldarg.1

Diff for Aggregate method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
        IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
        IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
-       mov     rcx,1B2C64C7258h
+       mov     rcx,2B86D927250h
        mov     rsi,qword ptr [rcx]
-       mov     rcx,7FF810064470h
+       mov     rcx,7FF82BE54680h
        mov     edx,4
-       call    coreclr!MetaDataGetDispenser+0x37fa0
-       mov     rcx,1B2C64C7268h
+       call    coreclr!GC_Initialize+0x42b20
+       mov     rcx,2B86D927260h
        mov     r8,qword ptr [rcx]
        test    r8,r8
        jne     M00_L00
-       mov     rcx,7FF80FF7C898h
-       call    coreclr!MetaDataGetDispenser+0x37ba0
+       mov     rcx,7FF82BD6C908h
+       call    coreclr!GC_Initialize+0x42720
        mov     rdi,rax
-       mov     rdx,1B2C64C7260h
+       mov     rdx,2B86D927258h
        mov     rdx,qword ptr [rdx]
        test    rdx,rdx
-       je      00007ff8`0ffa3691
+       je      00007ff8`2bd93571
        lea     rcx,[rdi+8]
-       call    coreclr!MetaDataGetDispenser+0x36700
-       mov     rdx,7FF80FFA31F0h
+       call    coreclr!GC_Initialize+0x41280
+       mov     rdx,7FF82BD92A48h
        mov     qword ptr [rdi+18h],rdx
        IL_0020: dup
        IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
        IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
        IL_002b: ret
-       mov     rcx,1B2C64C7268h
+       mov     rcx,2B86D927260h
        mov     rdx,rdi
-       call    coreclr!MetaDataGetDispenser+0x366d0
+       call    coreclr!GC_Initialize+0x41250
        mov     r8,rdi
 M00_L00:
        mov     rcx,rsi
        xor     edx,edx
-       mov     rax,7FF80FFA0A18h
+       mov     rax,7FF82BD92A58h
 ; Total bytes of code 146
 ; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
        IL_0000: ldarg.1

Diff for For method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_001c: ldlen
        IL_001d: conv.i4
        IL_001e: blt.s IL_0007
-       mov     rcx,1B4D8EF7258h
+       mov     rcx,211BBB87250h
        mov     rcx,qword ptr [rcx]
        cmp     dword ptr [rcx+8],0
        jle     M00_L01
 M00_L00:
        mov     r8,rcx
        cmp     edx,dword ptr [r8+8]
-       jae     00007ff8`0ff9321e
+       jae     00007ff8`0ff7348e
        movsxd  r9,edx
        mov     r8d,dword ptr [r8+r9*4+10h]
        movsxd  r8,r8d

Diff for For method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_001c: ldlen
        IL_001d: conv.i4
        IL_001e: blt.s IL_0007
-       mov     rcx,1B4D8EF7258h
+       mov     rcx,1E490007250h
        mov     rcx,qword ptr [rcx]
        cmp     dword ptr [rcx+8],0
        jle     M00_L01
 M00_L00:
        mov     r8,rcx
        cmp     edx,dword ptr [r8+8]
-       jae     00007ff8`0ff9321e
+       jae     00007ff8`2bd9350e
        movsxd  r9,edx
        mov     r8d,dword ptr [r8+r9*4+10h]
        movsxd  r8,r8d

Diff for ForReverse method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_000b: sub
        IL_000c: stloc.1
        IL_000d: br.s IL_001e
-       mov     rdx,22728847258h
+       mov     rdx,1A5F3EF7250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        dec     ecx
 M00_L00:
        mov     r8,rdx
        cmp     ecx,dword ptr [r8+8]
-       jae     00007ff8`0ffa321e
+       jae     00007ff8`0ff8348e
        movsxd  r9,ecx
        mov     r8d,dword ptr [r8+r9*4+10h]
        movsxd  r8,r8d

Diff for ForReverse method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_000b: sub
        IL_000c: stloc.1
        IL_000d: br.s IL_001e
-       mov     rdx,22728847258h
+       mov     rdx,1E3D7607250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        dec     ecx
 M00_L00:
        mov     r8,rdx
        cmp     ecx,dword ptr [r8+8]
-       jae     00007ff8`0ffa321e
+       jae     00007ff8`2bdb350e
        movsxd  r9,ecx
        mov     r8d,dword ptr [r8+r9*4+10h]
        movsxd  r8,r8d

Diff for ForLength method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

        IL_0008: ldlen
        IL_0009: conv.i4
        IL_000a: stloc.1
-       mov     rdx,1743F7C7258h
+       mov     rdx,1E910007250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        IL_000b: ldc.i4.0
 M00_L00:
        mov     r9,rdx
        cmp     r8d,dword ptr [r9+8]
-       jae     00007ff8`0ff73221
+       jae     00007ff8`0ff93491
        movsxd  r10,r8d
        mov     r9d,dword ptr [r9+r10*4+10h]
        movsxd  r9,r9d

Diff for ForLength method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_0008: ldlen
        IL_0009: conv.i4
        IL_000a: stloc.1
-       mov     rdx,1743F7C7258h
+       mov     rdx,2ACBAB97250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        IL_000b: ldc.i4.0
 M00_L00:
        mov     r9,rdx
        cmp     r8d,dword ptr [r9+8]
-       jae     00007ff8`0ff73221
+       jae     00007ff8`2bd73511
        movsxd  r10,r8d
        mov     r9d,dword ptr [r9+r10*4+10h]
        movsxd  r9,r9d

Diff for ForEach method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        xor     eax,eax
        IL_0003: ldsfld System.Int32[] ForEachLength.Bench::Array
        IL_0008: stloc.1
-       mov     rdx,20DF1AD7250h
+       mov     rdx,12D52BB7250h
        mov     rdx,qword ptr [rdx]
        IL_0009: ldc.i4.0
        IL_000a: stloc.2

Diff for Aggregate method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_0010: ldsfld ForEachLength.Bench/<>c ForEachLength.Bench/<>c::<>9
        IL_0015: ldftn System.Int64 ForEachLength.Bench/<>c::<Aggregate>b__4_0(System.Int64,System.Int32)
        IL_001b: newobj System.Void System.Func`3<System.Int64,System.Int32,System.Int64>::.ctor(System.Object,System.IntPtr)
-       mov     rcx,29593DA7250h
+       mov     rcx,2B86D927250h
        mov     rsi,qword ptr [rcx]
-       mov     rcx,7FF810043520h
+       mov     rcx,7FF82BE54680h
        mov     edx,4
-       call    coreclr!MetaDataGetDispenser+0x37fa0
-       mov     rcx,29593DA7260h
+       call    coreclr!GC_Initialize+0x42b20
+       mov     rcx,2B86D927260h
        mov     r8,qword ptr [rcx]
        test    r8,r8
        jne     M00_L00
-       mov     rcx,7FF80FF5C6D8h
-       call    coreclr!MetaDataGetDispenser+0x37ba0
+       mov     rcx,7FF82BD6C908h
+       call    coreclr!GC_Initialize+0x42720
        mov     rdi,rax
-       mov     rdx,29593DA7258h
+       mov     rdx,2B86D927258h
        mov     rdx,qword ptr [rdx]
        test    rdx,rdx
-       je      00007ff8`0ff834f1
+       je      00007ff8`2bd93571
        lea     rcx,[rdi+8]
-       call    coreclr!MetaDataGetDispenser+0x36700
-       mov     rdx,7FF80FF829C0h
+       call    coreclr!GC_Initialize+0x41280
+       mov     rdx,7FF82BD92A48h
        mov     qword ptr [rdi+18h],rdx
        IL_0020: dup
        IL_0021: stsfld System.Func`3<System.Int64,System.Int32,System.Int64> ForEachLength.Bench/<>c::<>9__4_0
        IL_0026: call !!1 System.Linq.Enumerable::Aggregate<System.Int32,System.Int64>(System.Collections.Generic.IEnumerable`1<!!0>,!!1,System.Func`3<!!1,!!0,!!1>)
        IL_002b: ret
-       mov     rcx,29593DA7260h
+       mov     rcx,2B86D927260h
        mov     rdx,rdi
-       call    coreclr!MetaDataGetDispenser+0x366d0
+       call    coreclr!GC_Initialize+0x41250
        mov     r8,rdi
 M00_L00:
        mov     rcx,rsi
        xor     edx,edx
-       mov     rax,7FF80FF829D0h
+       mov     rax,7FF82BD92A58h
 ; Total bytes of code 146
 ; ForEachLength.Bench+<>c.<Aggregate>b__4_0(Int64, Int32)
        IL_0000: ldarg.1

Diff for For method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_001c: ldlen
        IL_001d: conv.i4
        IL_001e: blt.s IL_0007
-       mov     rcx,211BBB87250h
+       mov     rcx,1E490007250h
        mov     rcx,qword ptr [rcx]
        cmp     dword ptr [rcx+8],0
        jle     M00_L01
 M00_L00:
        mov     r8,rcx
        cmp     edx,dword ptr [r8+8]
-       jae     00007ff8`0ff7348e
+       jae     00007ff8`2bd9350e
        movsxd  r9,edx
        mov     r8d,dword ptr [r8+r9*4+10h]
        movsxd  r8,r8d

Diff for ForReverse method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_000b: sub
        IL_000c: stloc.1
        IL_000d: br.s IL_001e
-       mov     rdx,1A5F3EF7250h
+       mov     rdx,1E3D7607250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        dec     ecx
 M00_L00:
        mov     r8,rdx
        cmp     ecx,dword ptr [r8+8]
-       jae     00007ff8`0ff8348e
+       jae     00007ff8`2bdb350e
        movsxd  r9,ecx
        mov     r8d,dword ptr [r8+r9*4+10h]
        movsxd  r8,r8d

Diff for ForLength method between: .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT .NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT

        IL_0008: ldlen
        IL_0009: conv.i4
        IL_000a: stloc.1
-       mov     rdx,1E910007250h
+       mov     rdx,2ACBAB97250h
        mov     rdx,qword ptr [rdx]
        mov     ecx,dword ptr [rdx+8]
        IL_000b: ldc.i4.0
 M00_L00:
        mov     r9,rdx
        cmp     r8d,dword ptr [r9+8]
-       jae     00007ff8`0ff93491
+       jae     00007ff8`2bd73511
        movsxd  r10,r8d
        mov     r9d,dword ptr [r9+r10*4+10h]
        movsxd  r9,r9d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment