1
string.Equals with OrdinalIgnoreCase performance boost from .NET 7 to .NET 8
Date Added (UTC):
10 Apr 2024 @ 23:26
Date Updated (UTC):10 Apr 2024 @ 23:26
.NET Version(s): Tag(s):
Added By:
.NET Developer and tech lead from Ireland!
Benchmark Results:
Benchmark Code:
using System.Collections.Generic;
using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Environments;
namespace Benchmarks
{
[Config(typeof(Config))]
[HideColumns(Column.Job, Column.RatioSD, Column.AllocRatio)]
[MemoryDiagnoser]
public class StringCompareDotNet8Benchmarks
{
[Benchmark]
[ArgumentsSource(nameof(TestData))]
public bool EqualsIgnoreCase(string s1, string s2) =>
s1.Equals(s2, StringComparison.OrdinalIgnoreCase);
public static IEnumerable<object[]> TestData()
{
yield return new object[]
{
@"Hi!", // 3 chars (to make sure overhead is not big)
@"HI!",
};
yield return new object[]
{
@"hello!!!", // 8 chars (switches to SIMD)
@"HELLO!!!",
};
yield return new object[]
{
@"hello world", // 11 chars (1xV128 + trailing elements)
@"HELLO WORLD",
};
yield return new object[]
{
@"C:\prj\runtime-main\src\coreclr\CMakeLists.txt", // 46 chars (5xV128 + trailing elements)
@"C:\prj\runtime-main\src\CORECLR\CMakeLists.txt",
};
yield return new object[]
{
@"Good bug reports make it easier for maintainers to verify and root cause the underlying problem. The better a bug report, the faster the problem will be resolved. Ideally, a bug report should contain the following information:", // 226 chars
@"GOOD bug reports make it easier for maintainers to verify and root cause the underlying problem. The better a bug report, the faster the problem will be resolved. Ideally, a bug report should contain the following information:",
};
}
private class Config : ManualConfig
{
public Config()
{
//setting compilation configs explicitly to avoid confusion
AddJob(Job.Default.WithId(".NET7")
.WithRuntime(CoreRuntime.Core70)
.WithBaseline(true)
.WithEnvironmentVariables(
new EnvironmentVariable("DOTNET_ReadyToRun", "0"), // Disable AOT
new EnvironmentVariable("DOTNET_TC_QuickJitForLoops", "1"), // Enable Quick Jit for loop
new EnvironmentVariable("DOTNET_TieredPGO", "1"))); // Turn on layered PGO
AddJob(Job.Default.WithId(".NET8")
.WithRuntime(CoreRuntime.Core80)
.WithEnvironmentVariables(
new EnvironmentVariable("DOTNET_ReadyToRun", "0"), // Disable AOT
new EnvironmentVariable("DOTNET_TC_QuickJitForLoops", "1"), // Enable Quick Jit for loop
new EnvironmentVariable("DOTNET_TieredPGO", "1"))); // Turn on layered PGO
SummaryStyle =
SummaryStyle.Default.WithRatioStyle(RatioStyle.Percentage);
}
}
}
}
Powered by SharpLab
// .NET 7, .NET 8
public bool EqualsIgnoreCase(string s1, string s2)
{
return s1.Equals(s2, StringComparison.OrdinalIgnoreCase);
}
Powered by SharpLab
// .NET 7
.assembly _
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = (
01 00 08 00 00 00 00 00
)
.custom instance void [System.Runtime]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = (
01 00 01 00 54 02 16 57 72 61 70 4e 6f 6e 45 78
63 65 70 74 69 6f 6e 54 68 72 6f 77 73 01
)
.custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = (
01 00 02 00 00 00 00 00
)
.permissionset reqmin = (
2e 01 80 8a 53 79 73 74 65 6d 2e 53 65 63 75 72
69 74 79 2e 50 65 72 6d 69 73 73 69 6f 6e 73 2e
53 65 63 75 72 69 74 79 50 65 72 6d 69 73 73 69
6f 6e 41 74 74 72 69 62 75 74 65 2c 20 53 79 73
74 65 6d 2e 52 75 6e 74 69 6d 65 2c 20 56 65 72
73 69 6f 6e 3d 37 2e 30 2e 30 2e 30 2c 20 43 75
6c 74 75 72 65 3d 6e 65 75 74 72 61 6c 2c 20 50
75 62 6c 69 63 4b 65 79 54 6f 6b 65 6e 3d 62 30
33 66 35 66 37 66 31 31 64 35 30 61 33 61 15 01
54 02 10 53 6b 69 70 56 65 72 69 66 69 63 61 74
69 6f 6e 01
)
.hash algorithm 0x00008004 // SHA1
.ver 0:0:0:0
}
.class private auto ansi '<Module>'
{
} // end of class <Module>
.class public auto ansi beforefieldinit Benchmarks.StringCompareDotNet8Benchmarks
extends [System.Runtime]System.Object
{
.custom instance void [BenchmarkDotNet]BenchmarkDotNet.Attributes.ConfigAttribute::.ctor(class [System.Runtime]System.Type) = (
01 00 30 42 65 6e 63 68 6d 61 72 6b 73 2e 53 74
72 69 6e 67 43 6f 6d 70 61 72 65 44 6f 74 4e 65
74 38 42 65 6e 63 68 6d 61 72 6b 73 2b 43 6f 6e
66 69 67 00 00
)
.custom instance void [BenchmarkDotNet]BenchmarkDotNet.Attributes.HideColumnsAttribute::.ctor(string[]) = (
01 00 03 00 00 00 03 4a 6f 62 07 52 61 74 69 6f
53 44 0b 41 6c 6c 6f 63 20 52 61 74 69 6f 00 00
)
.custom instance void [BenchmarkDotNet]BenchmarkDotNet.Attributes.MemoryDiagnoserAttribute::.ctor(bool) = (
01 00 01 00 00
)
// Nested Types
.class nested private auto ansi beforefieldinit Config
extends [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig
{
// Methods
.method public hidebysig specialname rtspecialname
instance void .ctor () cil managed
{
// Method begins at RVA 0x20b8
// Code size 242 (0xf2)
.maxstack 10
// sequence point: (line 68, col 13) to (line 68, col 28) in _
IL_0000: ldarg.0
IL_0001: call instance void [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig::.ctor()
// sequence point: (line 72, col 17) to (line 78, col 75) in _
IL_0006: ldarg.0
IL_0007: ldc.i4.1
IL_0008: newarr [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job
IL_000d: dup
IL_000e: ldc.i4.0
IL_000f: ldsfld !0 class [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobMode`1<class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job>::Default
IL_0014: ldstr ".NET7"
IL_0019: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithId(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, string)
IL_001e: ldsfld class [BenchmarkDotNet]BenchmarkDotNet.Environments.CoreRuntime [BenchmarkDotNet]BenchmarkDotNet.Environments.CoreRuntime::Core70
IL_0023: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithRuntime(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, class [BenchmarkDotNet]BenchmarkDotNet.Environments.Runtime)
IL_0028: ldc.i4.1
IL_0029: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithBaseline(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, bool)
IL_002e: ldc.i4.3
IL_002f: newarr [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable
IL_0034: dup
IL_0035: ldc.i4.0
IL_0036: ldstr "DOTNET_ReadyToRun"
IL_003b: ldstr "0"
IL_0040: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_0045: stelem.ref
IL_0046: dup
IL_0047: ldc.i4.1
IL_0048: ldstr "DOTNET_TC_QuickJitForLoops"
IL_004d: ldstr "1"
IL_0052: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_0057: stelem.ref
IL_0058: dup
IL_0059: ldc.i4.2
IL_005a: ldstr "DOTNET_TieredPGO"
IL_005f: ldstr "1"
IL_0064: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_0069: stelem.ref
IL_006a: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithEnvironmentVariables(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, class [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable[])
IL_006f: stelem.ref
IL_0070: call instance class [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig::AddJob(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job[])
IL_0075: pop
// sequence point: (line 80, col 17) to (line 85, col 75) in _
IL_0076: ldarg.0
IL_0077: ldc.i4.1
IL_0078: newarr [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job
IL_007d: dup
IL_007e: ldc.i4.0
IL_007f: ldsfld !0 class [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobMode`1<class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job>::Default
IL_0084: ldstr ".NET8"
IL_0089: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithId(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, string)
IL_008e: ldsfld class [BenchmarkDotNet]BenchmarkDotNet.Environments.CoreRuntime [BenchmarkDotNet]BenchmarkDotNet.Environments.CoreRuntime::Core80
IL_0093: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithRuntime(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, class [BenchmarkDotNet]BenchmarkDotNet.Environments.Runtime)
IL_0098: ldc.i4.3
IL_0099: newarr [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable
IL_009e: dup
IL_009f: ldc.i4.0
IL_00a0: ldstr "DOTNET_ReadyToRun"
IL_00a5: ldstr "0"
IL_00aa: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_00af: stelem.ref
IL_00b0: dup
IL_00b1: ldc.i4.1
IL_00b2: ldstr "DOTNET_TC_QuickJitForLoops"
IL_00b7: ldstr "1"
IL_00bc: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_00c1: stelem.ref
IL_00c2: dup
IL_00c3: ldc.i4.2
IL_00c4: ldstr "DOTNET_TieredPGO"
IL_00c9: ldstr "1"
IL_00ce: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_00d3: stelem.ref
IL_00d4: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithEnvironmentVariables(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, class [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable[])
IL_00d9: stelem.ref
IL_00da: call instance class [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig::AddJob(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job[])
IL_00df: pop
// sequence point: (line 87, col 17) to (line 88, col 80) in _
IL_00e0: ldarg.0
IL_00e1: ldsfld class [BenchmarkDotNet]BenchmarkDotNet.Reports.SummaryStyle [BenchmarkDotNet]BenchmarkDotNet.Reports.SummaryStyle::Default
IL_00e6: ldc.i4.1
IL_00e7: callvirt instance class [BenchmarkDotNet]BenchmarkDotNet.Reports.SummaryStyle [BenchmarkDotNet]BenchmarkDotNet.Reports.SummaryStyle::WithRatioStyle(valuetype [BenchmarkDotNet]BenchmarkDotNet.Columns.RatioStyle)
IL_00ec: call instance void [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig::set_SummaryStyle(class [BenchmarkDotNet]BenchmarkDotNet.Reports.SummaryStyle)
// sequence point: (line 89, col 13) to (line 89, col 14) in _
IL_00f1: ret
} // end of method Config::.ctor
} // end of class Config
.class nested private auto ansi sealed beforefieldinit '<TestData>d__1'
extends [System.Runtime]System.Object
implements .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = (
01 00 03 00 00 00 00 00 01 00 00
)
class [System.Runtime]System.Collections.Generic.IEnumerable`1<object[]>,
[System.Runtime]System.Collections.IEnumerable,
.custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = (
01 00 03 00 00 00 00 00 01 00 00
)
class [System.Runtime]System.Collections.Generic.IEnumerator`1<object[]>,
[System.Runtime]System.Collections.IEnumerator,
[System.Runtime]System.IDisposable
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
)
// Fields
.field private int32 '<>1__state'
.field private object[] '<>2__current'
.custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = (
01 00 01 00 00
)
.field private int32 '<>l__initialThreadId'
// Methods
.method public hidebysig specialname rtspecialname
instance void .ctor (
int32 '<>1__state'
) cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
// Method begins at RVA 0x21b6
// Code size 25 (0x19)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [System.Runtime]System.Object::.ctor()
IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_000d: ldarg.0
IL_000e: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0013: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>l__initialThreadId'
IL_0018: ret
} // end of method '<TestData>d__1'::.ctor
.method private final hidebysig newslot virtual
instance void System.IDisposable.Dispose () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance void [System.Runtime]System.IDisposable::Dispose()
// Method begins at RVA 0x21d0
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
} // end of method '<TestData>d__1'::System.IDisposable.Dispose
.method private final hidebysig newslot virtual
instance bool MoveNext () cil managed
{
.override method instance bool [System.Runtime]System.Collections.IEnumerator::MoveNext()
// Method begins at RVA 0x21d4
// Code size 268 (0x10c)
.maxstack 5
.locals init (
[0] int32
)
// sequence point: hidden
IL_0000: ldarg.0
IL_0001: ldfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_0006: stloc.0
IL_0007: ldloc.0
IL_0008: switch (IL_0027, IL_0053, IL_007f, IL_00ab, IL_00d7, IL_0103)
IL_0025: ldc.i4.0
IL_0026: ret
IL_0027: ldarg.0
IL_0028: ldc.i4.m1
IL_0029: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 35, col 13) to (line 39, col 15) in _
IL_002e: ldarg.0
IL_002f: ldc.i4.2
IL_0030: newarr [System.Runtime]System.Object
IL_0035: dup
IL_0036: ldc.i4.0
IL_0037: ldstr "Hi!"
IL_003c: stelem.ref
IL_003d: dup
IL_003e: ldc.i4.1
IL_003f: ldstr "HI!"
IL_0044: stelem.ref
IL_0045: stfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_004a: ldarg.0
IL_004b: ldc.i4.1
IL_004c: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_0051: ldc.i4.1
IL_0052: ret
// sequence point: hidden
IL_0053: ldarg.0
IL_0054: ldc.i4.m1
IL_0055: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 41, col 13) to (line 45, col 15) in _
IL_005a: ldarg.0
IL_005b: ldc.i4.2
IL_005c: newarr [System.Runtime]System.Object
IL_0061: dup
IL_0062: ldc.i4.0
IL_0063: ldstr "hello!!!"
IL_0068: stelem.ref
IL_0069: dup
IL_006a: ldc.i4.1
IL_006b: ldstr "HELLO!!!"
IL_0070: stelem.ref
IL_0071: stfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_0076: ldarg.0
IL_0077: ldc.i4.2
IL_0078: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_007d: ldc.i4.1
IL_007e: ret
// sequence point: hidden
IL_007f: ldarg.0
IL_0080: ldc.i4.m1
IL_0081: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 47, col 13) to (line 51, col 15) in _
IL_0086: ldarg.0
IL_0087: ldc.i4.2
IL_0088: newarr [System.Runtime]System.Object
IL_008d: dup
IL_008e: ldc.i4.0
IL_008f: ldstr "hello world"
IL_0094: stelem.ref
IL_0095: dup
IL_0096: ldc.i4.1
IL_0097: ldstr "HELLO WORLD"
IL_009c: stelem.ref
IL_009d: stfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_00a2: ldarg.0
IL_00a3: ldc.i4.3
IL_00a4: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_00a9: ldc.i4.1
IL_00aa: ret
// sequence point: hidden
IL_00ab: ldarg.0
IL_00ac: ldc.i4.m1
IL_00ad: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 53, col 13) to (line 57, col 15) in _
IL_00b2: ldarg.0
IL_00b3: ldc.i4.2
IL_00b4: newarr [System.Runtime]System.Object
IL_00b9: dup
IL_00ba: ldc.i4.0
IL_00bb: ldstr "C:\\prj\\runtime-main\\src\\coreclr\\CMakeLists.txt"
IL_00c0: stelem.ref
IL_00c1: dup
IL_00c2: ldc.i4.1
IL_00c3: ldstr "C:\\prj\\runtime-main\\src\\CORECLR\\CMakeLists.txt"
IL_00c8: stelem.ref
IL_00c9: stfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_00ce: ldarg.0
IL_00cf: ldc.i4.4
IL_00d0: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_00d5: ldc.i4.1
IL_00d6: ret
// sequence point: hidden
IL_00d7: ldarg.0
IL_00d8: ldc.i4.m1
IL_00d9: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 59, col 13) to (line 63, col 15) in _
IL_00de: ldarg.0
IL_00df: ldc.i4.2
IL_00e0: newarr [System.Runtime]System.Object
IL_00e5: dup
IL_00e6: ldc.i4.0
IL_00e7: ldstr "Good bug reports make it easier for maintainers to verify and root cause the underlying problem. The better a bug report, the faster the problem will be resolved. Ideally, a bug report should contain the following information:"
IL_00ec: stelem.ref
IL_00ed: dup
IL_00ee: ldc.i4.1
IL_00ef: ldstr "GOOD bug reports make it easier for maintainers to verify and root cause the underlying problem. The better a bug report, the faster the problem will be resolved. Ideally, a bug report should contain the following information:"
IL_00f4: stelem.ref
IL_00f5: stfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_00fa: ldarg.0
IL_00fb: ldc.i4.5
IL_00fc: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_0101: ldc.i4.1
IL_0102: ret
// sequence point: hidden
IL_0103: ldarg.0
IL_0104: ldc.i4.m1
IL_0105: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 64, col 9) to (line 64, col 10) in _
IL_010a: ldc.i4.0
IL_010b: ret
} // end of method '<TestData>d__1'::MoveNext
.method private final hidebysig specialname newslot virtual
instance object[] 'System.Collections.Generic.IEnumerator<System.Object[]>.get_Current' () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance !0 class [System.Runtime]System.Collections.Generic.IEnumerator`1<object[]>::get_Current()
.param [0]
.custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = (
01 00 01 00 00
)
// Method begins at RVA 0x22ec
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_0006: ret
} // end of method '<TestData>d__1'::'System.Collections.Generic.IEnumerator<System.Object[]>.get_Current'
.method private final hidebysig newslot virtual
instance void System.Collections.IEnumerator.Reset () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance void [System.Runtime]System.Collections.IEnumerator::Reset()
// Method begins at RVA 0x22f4
// Code size 6 (0x6)
.maxstack 8
IL_0000: newobj instance void [System.Runtime]System.NotSupportedException::.ctor()
IL_0005: throw
} // end of method '<TestData>d__1'::System.Collections.IEnumerator.Reset
.method private final hidebysig specialname newslot virtual
instance object System.Collections.IEnumerator.get_Current () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance object [System.Runtime]System.Collections.IEnumerator::get_Current()
// Method begins at RVA 0x22ec
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_0006: ret
} // end of method '<TestData>d__1'::System.Collections.IEnumerator.get_Current
.method private final hidebysig newslot virtual
instance class [System.Runtime]System.Collections.Generic.IEnumerator`1<object[]> 'System.Collections.Generic.IEnumerable<System.Object[]>.GetEnumerator' () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance class [System.Runtime]System.Collections.Generic.IEnumerator`1<!0> class [System.Runtime]System.Collections.Generic.IEnumerable`1<object[]>::GetEnumerator()
.param [0]
.custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = (
01 00 03 00 00 00 01 00 01 00 00
)
// Method begins at RVA 0x22fc
// Code size 43 (0x2b)
.maxstack 2
.locals init (
[0] class Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'
)
IL_0000: ldarg.0
IL_0001: ldfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
IL_0019: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_001e: ldarg.0
IL_001f: stloc.0
IL_0020: br.s IL_0029
IL_0022: ldc.i4.0
IL_0023: newobj instance void Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::.ctor(int32)
IL_0028: stloc.0
IL_0029: ldloc.0
IL_002a: ret
} // end of method '<TestData>d__1'::'System.Collections.Generic.IEnumerable<System.Object[]>.GetEnumerator'
.method private final hidebysig newslot virtual
instance class [System.Runtime]System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance class [System.Runtime]System.Collections.IEnumerator [System.Runtime]System.Collections.IEnumerable::GetEnumerator()
.param [0]
.custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = (
01 00 01 00 00
)
// Method begins at RVA 0x2333
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance class [System.Runtime]System.Collections.Generic.IEnumerator`1<object[]> Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'System.Collections.Generic.IEnumerable<System.Object[]>.GetEnumerator'()
IL_0006: ret
} // end of method '<TestData>d__1'::System.Collections.IEnumerable.GetEnumerator
// Properties
.property instance object[] 'System.Collections.Generic.IEnumerator<System.Object[]>.Current'()
{
.get instance object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'System.Collections.Generic.IEnumerator<System.Object[]>.get_Current'()
}
.property instance object System.Collections.IEnumerator.Current()
{
.get instance object Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::System.Collections.IEnumerator.get_Current()
}
} // end of class <TestData>d__1
// Methods
.method public hidebysig
instance bool EqualsIgnoreCase (
string s1,
string s2
) cil managed
{
.custom instance void System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = (
01 00 01 00 00
)
.custom instance void [BenchmarkDotNet.Annotations]BenchmarkDotNet.Attributes.BenchmarkAttribute::.ctor(int32, string) = (
01 00 1c 00 00 00 01 5f 00 00
)
.custom instance void [BenchmarkDotNet.Annotations]BenchmarkDotNet.Attributes.ArgumentsSourceAttribute::.ctor(string) = (
01 00 08 54 65 73 74 44 61 74 61 00 00
)
// Method begins at RVA 0x209d
// Code size 9 (0x9)
.maxstack 8
// sequence point: (line 31, col 13) to (line 31, col 62) in _
IL_0000: ldarg.1
IL_0001: ldarg.2
IL_0002: ldc.i4.5
IL_0003: callvirt instance bool [System.Runtime]System.String::Equals(string, valuetype [System.Runtime]System.StringComparison)
IL_0008: ret
} // end of method StringCompareDotNet8Benchmarks::EqualsIgnoreCase
.method public hidebysig static
class [System.Runtime]System.Collections.Generic.IEnumerable`1<object[]> TestData () cil managed
{
.custom instance void System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = (
01 00 01 00 00
)
.custom instance void [System.Runtime]System.Runtime.CompilerServices.IteratorStateMachineAttribute::.ctor(class [System.Runtime]System.Type) = (
01 00 38 42 65 6e 63 68 6d 61 72 6b 73 2e 53 74
72 69 6e 67 43 6f 6d 70 61 72 65 44 6f 74 4e 65
74 38 42 65 6e 63 68 6d 61 72 6b 73 2b 3c 54 65
73 74 44 61 74 61 3e 64 5f 5f 31 00 00
)
// Method begins at RVA 0x20a7
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldc.i4.s -2
IL_0002: newobj instance void Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::.ctor(int32)
IL_0007: ret
} // end of method StringCompareDotNet8Benchmarks::TestData
.method public hidebysig specialname rtspecialname
instance void .ctor () cil managed
{
// Method begins at RVA 0x20b0
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [System.Runtime]System.Object::.ctor()
IL_0006: ret
} // end of method StringCompareDotNet8Benchmarks::.ctor
} // end of class Benchmarks.StringCompareDotNet8Benchmarks
.class private auto ansi sealed beforefieldinit Microsoft.CodeAnalysis.EmbeddedAttribute
extends [System.Runtime]System.Attribute
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
)
.custom instance void Microsoft.CodeAnalysis.EmbeddedAttribute::.ctor() = (
01 00 00 00
)
// Methods
.method public hidebysig specialname rtspecialname
instance void .ctor () cil managed
{
// Method begins at RVA 0x2050
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [System.Runtime]System.Attribute::.ctor()
IL_0006: ret
} // end of method EmbeddedAttribute::.ctor
} // end of class Microsoft.CodeAnalysis.EmbeddedAttribute
.class private auto ansi sealed beforefieldinit System.Runtime.CompilerServices.NullableAttribute
extends [System.Runtime]System.Attribute
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
)
.custom instance void Microsoft.CodeAnalysis.EmbeddedAttribute::.ctor() = (
01 00 00 00
)
.custom instance void [System.Runtime]System.AttributeUsageAttribute::.ctor(valuetype [System.Runtime]System.AttributeTargets) = (
01 00 84 6b 00 00 02 00 54 02 0d 41 6c 6c 6f 77
4d 75 6c 74 69 70 6c 65 00 54 02 09 49 6e 68 65
72 69 74 65 64 00
)
// Fields
.field public initonly uint8[] NullableFlags
// Methods
.method public hidebysig specialname rtspecialname
instance void .ctor (
uint8 ''
) cil managed
{
// Method begins at RVA 0x2058
// Code size 23 (0x17)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [System.Runtime]System.Attribute::.ctor()
IL_0006: ldarg.0
IL_0007: ldc.i4.1
IL_0008: newarr [System.Runtime]System.Byte
IL_000d: dup
IL_000e: ldc.i4.0
IL_000f: ldarg.1
IL_0010: stelem.i1
IL_0011: stfld uint8[] System.Runtime.CompilerServices.NullableAttribute::NullableFlags
IL_0016: ret
} // end of method NullableAttribute::.ctor
.method public hidebysig specialname rtspecialname
instance void .ctor (
uint8[] ''
) cil managed
{
// Method begins at RVA 0x2070
// Code size 14 (0xe)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [System.Runtime]System.Attribute::.ctor()
IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld uint8[] System.Runtime.CompilerServices.NullableAttribute::NullableFlags
IL_000d: ret
} // end of method NullableAttribute::.ctor
} // end of class System.Runtime.CompilerServices.NullableAttribute
.class private auto ansi sealed beforefieldinit System.Runtime.CompilerServices.NullableContextAttribute
extends [System.Runtime]System.Attribute
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
)
.custom instance void Microsoft.CodeAnalysis.EmbeddedAttribute::.ctor() = (
01 00 00 00
)
.custom instance void [System.Runtime]System.AttributeUsageAttribute::.ctor(valuetype [System.Runtime]System.AttributeTargets) = (
01 00 4c 14 00 00 02 00 54 02 0d 41 6c 6c 6f 77
4d 75 6c 74 69 70 6c 65 00 54 02 09 49 6e 68 65
72 69 74 65 64 00
)
// Fields
.field public initonly uint8 Flag
// Methods
.method public hidebysig specialname rtspecialname
instance void .ctor (
uint8 ''
) cil managed
{
// Method begins at RVA 0x207f
// Code size 14 (0xe)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [System.Runtime]System.Attribute::.ctor()
IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld uint8 System.Runtime.CompilerServices.NullableContextAttribute::Flag
IL_000d: ret
} // end of method NullableContextAttribute::.ctor
} // end of class System.Runtime.CompilerServices.NullableContextAttribute
.class private auto ansi sealed beforefieldinit System.Runtime.CompilerServices.RefSafetyRulesAttribute
extends [System.Runtime]System.Attribute
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
)
.custom instance void Microsoft.CodeAnalysis.EmbeddedAttribute::.ctor() = (
01 00 00 00
)
.custom instance void [System.Runtime]System.AttributeUsageAttribute::.ctor(valuetype [System.Runtime]System.AttributeTargets) = (
01 00 02 00 00 00 02 00 54 02 0d 41 6c 6c 6f 77
4d 75 6c 74 69 70 6c 65 00 54 02 09 49 6e 68 65
72 69 74 65 64 00
)
// Fields
.field public initonly int32 Version
// Methods
.method public hidebysig specialname rtspecialname
instance void .ctor (
int32 ''
) cil managed
{
// Method begins at RVA 0x208e
// Code size 14 (0xe)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [System.Runtime]System.Attribute::.ctor()
IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld int32 System.Runtime.CompilerServices.RefSafetyRulesAttribute::Version
IL_000d: ret
} // end of method RefSafetyRulesAttribute::.ctor
} // end of class System.Runtime.CompilerServices.RefSafetyRulesAttribute
// .NET 8
.assembly _
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = (
01 00 08 00 00 00 00 00
)
.custom instance void [System.Runtime]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = (
01 00 01 00 54 02 16 57 72 61 70 4e 6f 6e 45 78
63 65 70 74 69 6f 6e 54 68 72 6f 77 73 01
)
.custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = (
01 00 02 00 00 00 00 00
)
.permissionset reqmin = (
2e 01 80 8a 53 79 73 74 65 6d 2e 53 65 63 75 72
69 74 79 2e 50 65 72 6d 69 73 73 69 6f 6e 73 2e
53 65 63 75 72 69 74 79 50 65 72 6d 69 73 73 69
6f 6e 41 74 74 72 69 62 75 74 65 2c 20 53 79 73
74 65 6d 2e 52 75 6e 74 69 6d 65 2c 20 56 65 72
73 69 6f 6e 3d 38 2e 30 2e 30 2e 30 2c 20 43 75
6c 74 75 72 65 3d 6e 65 75 74 72 61 6c 2c 20 50
75 62 6c 69 63 4b 65 79 54 6f 6b 65 6e 3d 62 30
33 66 35 66 37 66 31 31 64 35 30 61 33 61 15 01
54 02 10 53 6b 69 70 56 65 72 69 66 69 63 61 74
69 6f 6e 01
)
.hash algorithm 0x00008004 // SHA1
.ver 0:0:0:0
}
.class private auto ansi '<Module>'
{
} // end of class <Module>
.class public auto ansi beforefieldinit Benchmarks.StringCompareDotNet8Benchmarks
extends [System.Runtime]System.Object
{
.custom instance void [BenchmarkDotNet]BenchmarkDotNet.Attributes.ConfigAttribute::.ctor(class [System.Runtime]System.Type) = (
01 00 30 42 65 6e 63 68 6d 61 72 6b 73 2e 53 74
72 69 6e 67 43 6f 6d 70 61 72 65 44 6f 74 4e 65
74 38 42 65 6e 63 68 6d 61 72 6b 73 2b 43 6f 6e
66 69 67 00 00
)
.custom instance void [BenchmarkDotNet]BenchmarkDotNet.Attributes.HideColumnsAttribute::.ctor(string[]) = (
01 00 03 00 00 00 03 4a 6f 62 07 52 61 74 69 6f
53 44 0b 41 6c 6c 6f 63 20 52 61 74 69 6f 00 00
)
.custom instance void [BenchmarkDotNet]BenchmarkDotNet.Attributes.MemoryDiagnoserAttribute::.ctor(bool) = (
01 00 01 00 00
)
// Nested Types
.class nested private auto ansi beforefieldinit Config
extends [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig
{
// Methods
.method public hidebysig specialname rtspecialname
instance void .ctor () cil managed
{
// Method begins at RVA 0x206c
// Code size 242 (0xf2)
.maxstack 10
// sequence point: (line 68, col 13) to (line 68, col 28) in _
IL_0000: ldarg.0
IL_0001: call instance void [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig::.ctor()
// sequence point: (line 72, col 17) to (line 78, col 75) in _
IL_0006: ldarg.0
IL_0007: ldc.i4.1
IL_0008: newarr [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job
IL_000d: dup
IL_000e: ldc.i4.0
IL_000f: ldsfld !0 class [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobMode`1<class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job>::Default
IL_0014: ldstr ".NET7"
IL_0019: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithId(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, string)
IL_001e: ldsfld class [BenchmarkDotNet]BenchmarkDotNet.Environments.CoreRuntime [BenchmarkDotNet]BenchmarkDotNet.Environments.CoreRuntime::Core70
IL_0023: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithRuntime(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, class [BenchmarkDotNet]BenchmarkDotNet.Environments.Runtime)
IL_0028: ldc.i4.1
IL_0029: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithBaseline(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, bool)
IL_002e: ldc.i4.3
IL_002f: newarr [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable
IL_0034: dup
IL_0035: ldc.i4.0
IL_0036: ldstr "DOTNET_ReadyToRun"
IL_003b: ldstr "0"
IL_0040: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_0045: stelem.ref
IL_0046: dup
IL_0047: ldc.i4.1
IL_0048: ldstr "DOTNET_TC_QuickJitForLoops"
IL_004d: ldstr "1"
IL_0052: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_0057: stelem.ref
IL_0058: dup
IL_0059: ldc.i4.2
IL_005a: ldstr "DOTNET_TieredPGO"
IL_005f: ldstr "1"
IL_0064: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_0069: stelem.ref
IL_006a: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithEnvironmentVariables(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, class [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable[])
IL_006f: stelem.ref
IL_0070: call instance class [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig::AddJob(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job[])
IL_0075: pop
// sequence point: (line 80, col 17) to (line 85, col 75) in _
IL_0076: ldarg.0
IL_0077: ldc.i4.1
IL_0078: newarr [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job
IL_007d: dup
IL_007e: ldc.i4.0
IL_007f: ldsfld !0 class [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobMode`1<class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job>::Default
IL_0084: ldstr ".NET8"
IL_0089: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithId(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, string)
IL_008e: ldsfld class [BenchmarkDotNet]BenchmarkDotNet.Environments.CoreRuntime [BenchmarkDotNet]BenchmarkDotNet.Environments.CoreRuntime::Core80
IL_0093: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithRuntime(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, class [BenchmarkDotNet]BenchmarkDotNet.Environments.Runtime)
IL_0098: ldc.i4.3
IL_0099: newarr [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable
IL_009e: dup
IL_009f: ldc.i4.0
IL_00a0: ldstr "DOTNET_ReadyToRun"
IL_00a5: ldstr "0"
IL_00aa: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_00af: stelem.ref
IL_00b0: dup
IL_00b1: ldc.i4.1
IL_00b2: ldstr "DOTNET_TC_QuickJitForLoops"
IL_00b7: ldstr "1"
IL_00bc: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_00c1: stelem.ref
IL_00c2: dup
IL_00c3: ldc.i4.2
IL_00c4: ldstr "DOTNET_TieredPGO"
IL_00c9: ldstr "1"
IL_00ce: newobj instance void [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable::.ctor(string, string)
IL_00d3: stelem.ref
IL_00d4: call class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job [BenchmarkDotNet]BenchmarkDotNet.Jobs.JobExtensions::WithEnvironmentVariables(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job, class [BenchmarkDotNet]BenchmarkDotNet.Jobs.EnvironmentVariable[])
IL_00d9: stelem.ref
IL_00da: call instance class [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig::AddJob(class [BenchmarkDotNet]BenchmarkDotNet.Jobs.Job[])
IL_00df: pop
// sequence point: (line 87, col 17) to (line 88, col 80) in _
IL_00e0: ldarg.0
IL_00e1: ldsfld class [BenchmarkDotNet]BenchmarkDotNet.Reports.SummaryStyle [BenchmarkDotNet]BenchmarkDotNet.Reports.SummaryStyle::Default
IL_00e6: ldc.i4.1
IL_00e7: callvirt instance class [BenchmarkDotNet]BenchmarkDotNet.Reports.SummaryStyle [BenchmarkDotNet]BenchmarkDotNet.Reports.SummaryStyle::WithRatioStyle(valuetype [BenchmarkDotNet]BenchmarkDotNet.Columns.RatioStyle)
IL_00ec: call instance void [BenchmarkDotNet]BenchmarkDotNet.Configs.ManualConfig::set_SummaryStyle(class [BenchmarkDotNet]BenchmarkDotNet.Reports.SummaryStyle)
// sequence point: (line 89, col 13) to (line 89, col 14) in _
IL_00f1: ret
} // end of method Config::.ctor
} // end of class Config
.class nested private auto ansi sealed beforefieldinit '<TestData>d__1'
extends [System.Runtime]System.Object
implements .custom instance void [System.Runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = (
01 00 03 00 00 00 00 00 01 00 00
)
class [System.Runtime]System.Collections.Generic.IEnumerable`1<object[]>,
[System.Runtime]System.Collections.IEnumerable,
.custom instance void [System.Runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = (
01 00 03 00 00 00 00 00 01 00 00
)
class [System.Runtime]System.Collections.Generic.IEnumerator`1<object[]>,
[System.Runtime]System.Collections.IEnumerator,
[System.Runtime]System.IDisposable
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
)
// Fields
.field private int32 '<>1__state'
.field private object[] '<>2__current'
.custom instance void [System.Runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = (
01 00 01 00 00
)
.field private int32 '<>l__initialThreadId'
// Methods
.method public hidebysig specialname rtspecialname
instance void .ctor (
int32 '<>1__state'
) cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
// Method begins at RVA 0x216a
// Code size 25 (0x19)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [System.Runtime]System.Object::.ctor()
IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_000d: ldarg.0
IL_000e: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0013: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>l__initialThreadId'
IL_0018: ret
} // end of method '<TestData>d__1'::.ctor
.method private final hidebysig newslot virtual
instance void System.IDisposable.Dispose () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance void [System.Runtime]System.IDisposable::Dispose()
// Method begins at RVA 0x2184
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
} // end of method '<TestData>d__1'::System.IDisposable.Dispose
.method private final hidebysig newslot virtual
instance bool MoveNext () cil managed
{
.override method instance bool [System.Runtime]System.Collections.IEnumerator::MoveNext()
// Method begins at RVA 0x2188
// Code size 268 (0x10c)
.maxstack 5
.locals init (
[0] int32
)
// sequence point: hidden
IL_0000: ldarg.0
IL_0001: ldfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_0006: stloc.0
IL_0007: ldloc.0
IL_0008: switch (IL_0027, IL_0053, IL_007f, IL_00ab, IL_00d7, IL_0103)
IL_0025: ldc.i4.0
IL_0026: ret
IL_0027: ldarg.0
IL_0028: ldc.i4.m1
IL_0029: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 35, col 13) to (line 39, col 15) in _
IL_002e: ldarg.0
IL_002f: ldc.i4.2
IL_0030: newarr [System.Runtime]System.Object
IL_0035: dup
IL_0036: ldc.i4.0
IL_0037: ldstr "Hi!"
IL_003c: stelem.ref
IL_003d: dup
IL_003e: ldc.i4.1
IL_003f: ldstr "HI!"
IL_0044: stelem.ref
IL_0045: stfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_004a: ldarg.0
IL_004b: ldc.i4.1
IL_004c: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_0051: ldc.i4.1
IL_0052: ret
// sequence point: hidden
IL_0053: ldarg.0
IL_0054: ldc.i4.m1
IL_0055: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 41, col 13) to (line 45, col 15) in _
IL_005a: ldarg.0
IL_005b: ldc.i4.2
IL_005c: newarr [System.Runtime]System.Object
IL_0061: dup
IL_0062: ldc.i4.0
IL_0063: ldstr "hello!!!"
IL_0068: stelem.ref
IL_0069: dup
IL_006a: ldc.i4.1
IL_006b: ldstr "HELLO!!!"
IL_0070: stelem.ref
IL_0071: stfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_0076: ldarg.0
IL_0077: ldc.i4.2
IL_0078: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_007d: ldc.i4.1
IL_007e: ret
// sequence point: hidden
IL_007f: ldarg.0
IL_0080: ldc.i4.m1
IL_0081: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 47, col 13) to (line 51, col 15) in _
IL_0086: ldarg.0
IL_0087: ldc.i4.2
IL_0088: newarr [System.Runtime]System.Object
IL_008d: dup
IL_008e: ldc.i4.0
IL_008f: ldstr "hello world"
IL_0094: stelem.ref
IL_0095: dup
IL_0096: ldc.i4.1
IL_0097: ldstr "HELLO WORLD"
IL_009c: stelem.ref
IL_009d: stfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_00a2: ldarg.0
IL_00a3: ldc.i4.3
IL_00a4: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_00a9: ldc.i4.1
IL_00aa: ret
// sequence point: hidden
IL_00ab: ldarg.0
IL_00ac: ldc.i4.m1
IL_00ad: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 53, col 13) to (line 57, col 15) in _
IL_00b2: ldarg.0
IL_00b3: ldc.i4.2
IL_00b4: newarr [System.Runtime]System.Object
IL_00b9: dup
IL_00ba: ldc.i4.0
IL_00bb: ldstr "C:\\prj\\runtime-main\\src\\coreclr\\CMakeLists.txt"
IL_00c0: stelem.ref
IL_00c1: dup
IL_00c2: ldc.i4.1
IL_00c3: ldstr "C:\\prj\\runtime-main\\src\\CORECLR\\CMakeLists.txt"
IL_00c8: stelem.ref
IL_00c9: stfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_00ce: ldarg.0
IL_00cf: ldc.i4.4
IL_00d0: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_00d5: ldc.i4.1
IL_00d6: ret
// sequence point: hidden
IL_00d7: ldarg.0
IL_00d8: ldc.i4.m1
IL_00d9: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 59, col 13) to (line 63, col 15) in _
IL_00de: ldarg.0
IL_00df: ldc.i4.2
IL_00e0: newarr [System.Runtime]System.Object
IL_00e5: dup
IL_00e6: ldc.i4.0
IL_00e7: ldstr "Good bug reports make it easier for maintainers to verify and root cause the underlying problem. The better a bug report, the faster the problem will be resolved. Ideally, a bug report should contain the following information:"
IL_00ec: stelem.ref
IL_00ed: dup
IL_00ee: ldc.i4.1
IL_00ef: ldstr "GOOD bug reports make it easier for maintainers to verify and root cause the underlying problem. The better a bug report, the faster the problem will be resolved. Ideally, a bug report should contain the following information:"
IL_00f4: stelem.ref
IL_00f5: stfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_00fa: ldarg.0
IL_00fb: ldc.i4.5
IL_00fc: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_0101: ldc.i4.1
IL_0102: ret
// sequence point: hidden
IL_0103: ldarg.0
IL_0104: ldc.i4.m1
IL_0105: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
// sequence point: (line 64, col 9) to (line 64, col 10) in _
IL_010a: ldc.i4.0
IL_010b: ret
} // end of method '<TestData>d__1'::MoveNext
.method private final hidebysig specialname newslot virtual
instance object[] 'System.Collections.Generic.IEnumerator<System.Object[]>.get_Current' () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance !0 class [System.Runtime]System.Collections.Generic.IEnumerator`1<object[]>::get_Current()
.param [0]
.custom instance void [System.Runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = (
01 00 01 00 00
)
// Method begins at RVA 0x22a0
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_0006: ret
} // end of method '<TestData>d__1'::'System.Collections.Generic.IEnumerator<System.Object[]>.get_Current'
.method private final hidebysig newslot virtual
instance void System.Collections.IEnumerator.Reset () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance void [System.Runtime]System.Collections.IEnumerator::Reset()
// Method begins at RVA 0x22a8
// Code size 6 (0x6)
.maxstack 8
IL_0000: newobj instance void [System.Runtime]System.NotSupportedException::.ctor()
IL_0005: throw
} // end of method '<TestData>d__1'::System.Collections.IEnumerator.Reset
.method private final hidebysig specialname newslot virtual
instance object System.Collections.IEnumerator.get_Current () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance object [System.Runtime]System.Collections.IEnumerator::get_Current()
// Method begins at RVA 0x22a0
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>2__current'
IL_0006: ret
} // end of method '<TestData>d__1'::System.Collections.IEnumerator.get_Current
.method private final hidebysig newslot virtual
instance class [System.Runtime]System.Collections.Generic.IEnumerator`1<object[]> 'System.Collections.Generic.IEnumerable<System.Object[]>.GetEnumerator' () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance class [System.Runtime]System.Collections.Generic.IEnumerator`1<!0> class [System.Runtime]System.Collections.Generic.IEnumerable`1<object[]>::GetEnumerator()
.param [0]
.custom instance void [System.Runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = (
01 00 03 00 00 00 01 00 01 00 00
)
// Method begins at RVA 0x22b0
// Code size 43 (0x2b)
.maxstack 2
.locals init (
[0] class Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'
)
IL_0000: ldarg.0
IL_0001: ldfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
IL_0019: stfld int32 Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'<>1__state'
IL_001e: ldarg.0
IL_001f: stloc.0
IL_0020: br.s IL_0029
IL_0022: ldc.i4.0
IL_0023: newobj instance void Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::.ctor(int32)
IL_0028: stloc.0
IL_0029: ldloc.0
IL_002a: ret
} // end of method '<TestData>d__1'::'System.Collections.Generic.IEnumerable<System.Object[]>.GetEnumerator'
.method private final hidebysig newslot virtual
instance class [System.Runtime]System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () cil managed
{
.custom instance void [System.Runtime]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
01 00 00 00
)
.override method instance class [System.Runtime]System.Collections.IEnumerator [System.Runtime]System.Collections.IEnumerable::GetEnumerator()
.param [0]
.custom instance void [System.Runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = (
01 00 01 00 00
)
// Method begins at RVA 0x22e7
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance class [System.Runtime]System.Collections.Generic.IEnumerator`1<object[]> Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'System.Collections.Generic.IEnumerable<System.Object[]>.GetEnumerator'()
IL_0006: ret
} // end of method '<TestData>d__1'::System.Collections.IEnumerable.GetEnumerator
// Properties
.property instance object[] 'System.Collections.Generic.IEnumerator<System.Object[]>.Current'()
{
.get instance object[] Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::'System.Collections.Generic.IEnumerator<System.Object[]>.get_Current'()
}
.property instance object System.Collections.IEnumerator.Current()
{
.get instance object Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::System.Collections.IEnumerator.get_Current()
}
} // end of class <TestData>d__1
// Methods
.method public hidebysig
instance bool EqualsIgnoreCase (
string s1,
string s2
) cil managed
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = (
01 00 01 00 00
)
.custom instance void [BenchmarkDotNet.Annotations]BenchmarkDotNet.Attributes.BenchmarkAttribute::.ctor(int32, string) = (
01 00 1c 00 00 00 01 5f 00 00
)
.custom instance void [BenchmarkDotNet.Annotations]BenchmarkDotNet.Attributes.ArgumentsSourceAttribute::.ctor(string) = (
01 00 08 54 65 73 74 44 61 74 61 00 00
)
// Method begins at RVA 0x2050
// Code size 9 (0x9)
.maxstack 8
// sequence point: (line 31, col 13) to (line 31, col 62) in _
IL_0000: ldarg.1
IL_0001: ldarg.2
IL_0002: ldc.i4.5
IL_0003: callvirt instance bool [System.Runtime]System.String::Equals(string, valuetype [System.Runtime]System.StringComparison)
IL_0008: ret
} // end of method StringCompareDotNet8Benchmarks::EqualsIgnoreCase
.method public hidebysig static
class [System.Runtime]System.Collections.Generic.IEnumerable`1<object[]> TestData () cil managed
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = (
01 00 01 00 00
)
.custom instance void [System.Runtime]System.Runtime.CompilerServices.IteratorStateMachineAttribute::.ctor(class [System.Runtime]System.Type) = (
01 00 38 42 65 6e 63 68 6d 61 72 6b 73 2e 53 74
72 69 6e 67 43 6f 6d 70 61 72 65 44 6f 74 4e 65
74 38 42 65 6e 63 68 6d 61 72 6b 73 2b 3c 54 65
73 74 44 61 74 61 3e 64 5f 5f 31 00 00
)
// Method begins at RVA 0x205a
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldc.i4.s -2
IL_0002: newobj instance void Benchmarks.StringCompareDotNet8Benchmarks/'<TestData>d__1'::.ctor(int32)
IL_0007: ret
} // end of method StringCompareDotNet8Benchmarks::TestData
.method public hidebysig specialname rtspecialname
instance void .ctor () cil managed
{
// Method begins at RVA 0x2063
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [System.Runtime]System.Object::.ctor()
IL_0006: ret
} // end of method StringCompareDotNet8Benchmarks::.ctor
} // end of class Benchmarks.StringCompareDotNet8Benchmarks
Powered by SharpLab
|
|
Benchmark Description:
### General Setup Overview
The benchmark setup provided is designed to compare the performance of string comparison operations in different versions of .NET, specifically targeting .NET 7 and .NET 8. The benchmarks are implemented using the BenchmarkDotNet library, a powerful tool for benchmarking .NET code, which provides detailed insights into the performance characteristics of the code being tested.
#### Configuration Details:
- **.NET Versions:** The benchmarks are configured to run against two different .NET versions: .NET 7 and .NET 8. This is achieved by specifying two jobs in the configuration, each targeting a different version of the .NET Core runtime (`CoreRuntime.Core70` and `CoreRuntime.Core80`).
- **Compilation Configurations:** The benchmarks disable Ahead-of-Time (AOT) compilation by setting the `DOTNET_ReadyToRun` environment variable to "0". They also enable Quick JIT for loops and Tiered Profile-Guided Optimization (PGO) by setting the `DOTNET_TC_QuickJitForLoops` and `DOTNET_TieredPGO` environment variables to "1".
- **BenchmarkDotNet Configuration:** The benchmarks use a custom configuration class (`Config`) that extends `ManualConfig`. This class specifies the jobs to run and sets the summary style to display ratios as percentages. It also hides certain columns (`Column.Job`, `Column.RatioSD`, `Column.AllocRatio`) for clarity in the output.
### Benchmark Method: `EqualsIgnoreCase`
#### Purpose:
The `EqualsIgnoreCase` method is designed to benchmark the performance of case-insensitive string comparisons across different string lengths and contents. This method uses the `String.Equals` method with the `StringComparison.OrdinalIgnoreCase` option to perform the comparison.
#### Performance Aspect Tested:
This benchmark tests how efficiently the .NET runtime can perform case-insensitive string comparisons, a common operation in many applications. It specifically looks at:
- The overhead of case-insensitive comparisons for short strings.
- The utilization of SIMD (Single Instruction, Multiple Data) instructions for medium-length strings.
- The performance for strings of various lengths, including those that may or may not fit into processor cache lines or require multiple SIMD operations.
#### Expected Results/Insights:
- **Short Strings:** For very short strings (e.g., 3 characters), the benchmark tests the overhead of the comparison operation. The expectation is that the performance impact is minimal, but interesting to compare between .NET versions.
- **Medium-Length Strings:** For strings that are long enough to benefit from SIMD optimizations (e.g., 8 characters), we expect to see a significant performance improvement, especially in newer .NET versions that might have enhanced SIMD support.
- **Long Strings:** For longer strings (e.g., 46 and 226 characters), the benchmark tests the efficiency of the runtime's string comparison algorithms over multiple processor cache lines and SIMD operations. Improvements in these areas could indicate optimizations in the .NET runtime's string handling or JIT compilation strategies.
By comparing the performance across different .NET versions, developers and performance engineers can gain insights into the runtime and JIT compiler optimizations that have been introduced. This can help in making informed decisions about upgrading projects to newer .NET versions or optimizing string comparison operations in their applications.