Open EgorBo opened 1 month ago
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 4 logical and 2 physical cores
Job-GNQZSD : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-YCNKIV : .NET 9.0.0 (9.0.24.40507), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
EnvironmentVariables=DOTNET_JitDisasm=TernLog
Method | Runtime | Mean | Error | Ratio |
---|---|---|---|---|
TernLog | .NET 8.0 | 35.68 ns | 0.004 ns | 1.00 |
TernLog | .NET 9.0 | 26.24 ns | 0.006 ns | 0.74 |
Codegen diff: https://www.diffchecker.com/F45CXxJW/
@EgorBot -intel -arm64 -pr 107831
using BenchmarkDotNet.Attributes;
public class Bench
{
[Benchmark]
public int CountSymbols()
{
int count = 0;
foreach (var c in "\t\tHello world\n\nSome text...\n")
count += Test(c) ? 1 : 0;
return count;
}
bool Test(char c)
{
if (c is ' ' or '\t' or '\r' or '\n' or '.')
return true;
return false;
}
}
@EgorBot -intel -arm64 -pr 107831
using BenchmarkDotNet.Attributes;
public class Bench
{
[Benchmark]
public int CountSymbols()
{
int count = 0;
foreach (var c in "\t\tHello world\n\nSome text...\n")
count += Test(c) ? 1 : 0;
return count;
}
bool Test(char c)
{
if (c is ' ' or '\t' or '\r' or '\n' or '.')
return true;
return false;
}
}
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
Job-CODODF : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-CJIWZO : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
CountSymbols | Main | 61.53 ns | 0.208 ns | 1.00 |
CountSymbols | PR | 59.67 ns | 0.027 ns | 0.97 |
AzureAmpere
BenchmarkDotNet v0.14.0, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
AzureAmpere
Job-WEKMJI : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Job-FQBLQA : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
CountSymbols | Main | 70.78 ns | 0.005 ns | 1.00 |
CountSymbols | PR | 70.80 ns | 0.007 ns | 1.00 |
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
Job-EXYRDP : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-DEBFBF : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
CountSymbols | Main | 61.46 ns | 0.109 ns | 1.00 |
CountSymbols | PR | 59.38 ns | 0.007 ns | 0.97 |
AzureAmpere
BenchmarkDotNet v0.14.0, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
AzureAmpere
Job-SPXIWE : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Job-YRTNLE : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
CountSymbols | Main | 70.77 ns | 0.020 ns | 1.00 |
CountSymbols | PR | 70.66 ns | 0.006 ns | 1.00 |
@EgorBot -intel --runtimes net8.0 net9.0
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text.Json.Nodes;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Diagnosers;
BenchmarkRunner.Run<JsonNodeBenchmarks>(args: args);
[MemoryDiagnoser]
public class JsonNodeBenchmarks
{
[Benchmark]
public JsonObject CreateJsonObject()
{
return new JsonObject()
{
["applicationVersion"] = "1.2.3",
["frameworkDescription"] = RuntimeInformation.FrameworkDescription,
["operatingSystem"] = new JsonObject()
{
["description"] = RuntimeInformation.OSDescription,
["architecture"] = RuntimeInformation.OSArchitecture.ToString(),
["version"] = Environment.OSVersion.VersionString,
["is64Bit"] = Environment.Is64BitOperatingSystem,
},
["process"] = new JsonObject()
{
["architecture"] = RuntimeInformation.ProcessArchitecture.ToString(),
["is64BitProcess"] = Environment.Is64BitProcess,
["isNativeAoT"] = !RuntimeFeature.IsDynamicCodeSupported,
["isPrivilegedProcess"] = Environment.IsPrivilegedProcess,
},
};
}
}
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 4 logical and 2 physical cores
Job-EGGJLN : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-INWFFV : .NET 9.0.0 (9.0.24.43107), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method | Runtime | Mean | Error | Ratio | Gen0 | Allocated | Alloc Ratio |
---|---|---|---|---|---|---|---|
CreateJsonObject | .NET 8.0 | 521.5 ns | 1.14 ns | 1.00 | 0.0505 | 1.24 KB | 1.00 |
CreateJsonObject | .NET 9.0 | 934.5 ns | 2.82 ns | 1.79 | 0.0858 | 2.12 KB | 1.70 |
@EgorBot -intel --runtimes net8.0 net9.0 --envvars DOTNET_GCDynamicAdaptationMode=0
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text.Json.Nodes;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Diagnosers;
BenchmarkRunner.Run<JsonNodeBenchmarks>(args: args);
[MemoryDiagnoser]
public class JsonNodeBenchmarks
{
[Benchmark]
public JsonObject CreateJsonObject()
{
return new JsonObject()
{
["applicationVersion"] = "1.2.3",
["frameworkDescription"] = RuntimeInformation.FrameworkDescription,
["operatingSystem"] = new JsonObject()
{
["description"] = RuntimeInformation.OSDescription,
["architecture"] = RuntimeInformation.OSArchitecture.ToString(),
["version"] = Environment.OSVersion.VersionString,
["is64Bit"] = Environment.Is64BitOperatingSystem,
},
["process"] = new JsonObject()
{
["architecture"] = RuntimeInformation.ProcessArchitecture.ToString(),
["is64BitProcess"] = Environment.Is64BitProcess,
["isNativeAoT"] = !RuntimeFeature.IsDynamicCodeSupported,
["isPrivilegedProcess"] = Environment.IsPrivilegedProcess,
},
};
}
}
@EgorBot -intel --runtimes net8.0 net9.0 --envvars DOTNET_GCDynamicAdaptationMode:0 DOTNET_ReadyToRun:0 DOTNET_TieredCompilation:0
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text.Json.Nodes;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Diagnosers;
BenchmarkRunner.Run<JsonNodeBenchmarks>(args: args);
[MemoryDiagnoser]
public class JsonNodeBenchmarks
{
[Benchmark]
public JsonObject CreateJsonObject()
{
return new JsonObject()
{
["applicationVersion"] = "1.2.3",
["frameworkDescription"] = RuntimeInformation.FrameworkDescription,
["operatingSystem"] = new JsonObject()
{
["description"] = RuntimeInformation.OSDescription,
["architecture"] = RuntimeInformation.OSArchitecture.ToString(),
["version"] = Environment.OSVersion.VersionString,
["is64Bit"] = Environment.Is64BitOperatingSystem,
},
["process"] = new JsonObject()
{
["architecture"] = RuntimeInformation.ProcessArchitecture.ToString(),
["is64BitProcess"] = Environment.Is64BitProcess,
["isNativeAoT"] = !RuntimeFeature.IsDynamicCodeSupported,
["isPrivilegedProcess"] = Environment.IsPrivilegedProcess,
},
};
}
}
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 4 logical and 2 physical cores
Job-YMTETL : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-ZEKBEW : .NET 9.0.0 (9.0.24.43107), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
EnvironmentVariables=DOTNET_GCDynamicAdaptationMode=0,DOTNET_ReadyToRun=0,DOTNET_TieredCompilation=0
Method | Runtime | Mean | Error | Ratio | Gen0 | Allocated | Alloc Ratio |
---|---|---|---|---|---|---|---|
CreateJsonObject | .NET 8.0 | 603.5 ns | 8.28 ns | 1.00 | 0.0505 | 1.24 KB | 1.00 |
CreateJsonObject | .NET 9.0 | 1,103.5 ns | 9.94 ns | 1.83 | 0.0858 | 2.12 KB | 1.70 |
@EgorBot -intel --envvars DOTNET_JitDisasm:TernLog --runtimes net9.0
using System.Runtime.Intrinsics;
using BenchmarkDotNet.Attributes;
public class Bench
{
byte[] a = new byte[1024];
byte[] b = new byte[1024];
byte[] c = new byte[1024];
[Benchmark]
public void TernLog()
{
ref byte bA = ref a[0];
ref byte bB = ref b[0];
ref byte bC = ref c[0];
for (nuint i = 0; i < 1024; i+=64)
{
var v1 = Vector512.LoadUnsafe(ref bA, i);
var v2 = Vector512.LoadUnsafe(ref bB, i);
var v3 = Vector512.LoadUnsafe(ref bC, i);
(v1 & v2 ^ v3).StoreUnsafe(ref bA, i);
}
}
}
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 4 logical and 2 physical cores
Job-DQFASQ : .NET 9.0.0 (9.0.24.43107), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
EnvironmentVariables=DOTNET_JitDisasm=TernLog Runtime=.NET 9.0 Toolchain=net9.0
StdDev=0.016 ns
Method | Mean | Error |
---|---|---|
TernLog | 35.78 ns | 0.021 ns |
@EgorBot -intel -arm64 -perf -pr 106525
using System;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkRunner.Run<Bench>(args: args);
public class Bench
{
[Benchmark]
public Guid Foo() => Guid.CreateVersion7();
}
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
Job-EDRPXH : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-WXAIOM : .NET 9.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
Foo | Main | 372.9 ns | 0.18 ns | 1.00 |
Foo | PR | 368.8 ns | 0.04 ns | 0.99 |
Bench_Foo
:Flame graphs: Main vs PR 🔥 Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR
AzureAmpere
BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
AzureAmpere
Job-FNEVXD : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Job-INDVPS : .NET 9.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
Foo | Main | 468.3 ns | 0.23 ns | 1.00 |
Foo | PR | 462.9 ns | 0.39 ns | 0.99 |
Bench_Foo
:Flame graphs: Main vs PR 🔥 Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR
@EgorBot -intel -perf -pr 106525
using System;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkRunner.Run<Bench>(args: args);
public class Bench
{
[Benchmark]
public Guid Foo() => Guid.CreateVersion7();
}
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
Job-IVDNRB : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-SLGQZJ : .NET 9.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
Foo | Main | 373.6 ns | 0.05 ns | 1.00 |
Foo | PR | 366.0 ns | 0.11 ns | 0.98 |
Bench_Foo
:Flame graphs: Main vs PR 🔥 Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR
@EgorBot -intel -pr 108153
using BenchmarkDotNet.Attributes;
public class Bench
{
IList<int> list = new int[10];
[Benchmark]
public void Test()
{
foreach (var _ in list)
{
}
}
}
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
Job-CDOEWJ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-PHDJYG : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
Test | Main | 30.86 ns | 0.168 ns | 1.00 |
Test | PR | 26.69 ns | 0.076 ns | 0.87 |
@EgorBot -aws_intel -aws_amd -perf -pr 108205
using System.Buffers.Binary;
using BenchmarkDotNet.Attributes;
public class Bench
{
int[] arr1 = new int[1024];
int[] arr2 = new int[1024];
[Benchmark]
public void Reverse() =>
BinaryPrimitives.ReverseEndianness(arr1, arr2);
}
AwsAmd
BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
AMD EPYC 9R14, 1 CPU, 8 logical and 8 physical cores
Job-QFXKFH : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-VYBXLI : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
RatioSD=0.02
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
Reverse | Main | 41.77 ns | 0.690 ns | 1.00 |
Reverse | PR | 56.95 ns | 0.442 ns | 1.36 |
Bench_Reverse
:Flame graphs: Main vs PR 🔥 Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR
AwsIntel
BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
Intel Xeon Platinum 8488C, 1 CPU, 8 logical and 4 physical cores
Job-KSSNAJ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-JQVRCF : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
Reverse | Main | 50.71 ns | 1.039 ns | 1.00 |
Reverse | PR | 44.54 ns | 0.901 ns | 0.88 |
Bench_Reverse
:Flame graphs: Main vs PR 🔥 Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR
@EgorBot -intel -perf -pr 108205 -keep
using System.Buffers.Binary;
using BenchmarkDotNet.Attributes;
public class Bench
{
int[] arr1 = new int[1024];
int[] arr2 = new int[1024];
[Benchmark]
public void Reverse() =>
BinaryPrimitives.ReverseEndianness(arr1, arr2);
}
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
Job-QIPGDL : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-TJAHAZ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
Reverse | Main | 80.15 ns | 0.360 ns | 1.00 |
Reverse | PR | 80.17 ns | 0.028 ns | 1.00 |
Bench_Reverse
:Flame graphs: Main vs PR 🔥 Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR
@EgorBot -intel -perf -pr 108205 -keep
using System.Buffers.Binary;
using BenchmarkDotNet.Attributes;
public class Bench
{
int[] arr1 = new int[1024];
int[] arr2 = new int[1024];
[Benchmark]
public void Reverse() =>
BinaryPrimitives.ReverseEndianness(arr1, arr2);
}
AzureIntel
BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
Job-IEXARG : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job-FEJAOC : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method | Toolchain | Mean | Error | Ratio |
---|---|---|---|---|
Reverse | Main | 81.64 ns | 0.025 ns | 1.00 |
Reverse | PR | 80.49 ns | 0.020 ns | 0.99 |
Bench_Reverse
:Flame graphs: Main vs PR 🔥 Hot asm: Main vs PR Hot functions: Main vs PR Counters: Main vs PR
@EgorBot -aws_intel
using System.Buffers.Binary;
using BenchmarkDotNet.Attributes;
public class Bench
{
int[] arr1 = new int[1024];
int[] arr2 = new int[1024];
[Benchmark]
public void Reverse() =>
BinaryPrimitives.ReverseEndianness(arr1, arr2);
}
@EgorBot -aws_intel
using System.Buffers.Binary;
using BenchmarkDotNet.Attributes;
public class Bench
{
int[] arr1 = new int[1024];
int[] arr2 = new int[1024];
[Benchmark]
public void Reverse() =>
BinaryPrimitives.ReverseEndianness(arr1, arr2);
}
AwsIntel
BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
Intel Xeon Platinum 8488C, 1 CPU, 4 logical and 2 physical cores
DefaultJob : .NET 9.0.0 (9.0.24.43107), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
StdDev=0.221 ns
Method | Mean | Error |
---|---|---|
Reverse | 73.14 ns | 0.250 ns |
cc @EgorBo ([logs]())
@EgorBot -aws_intel
using System.Buffers.Binary;
using BenchmarkDotNet.Attributes;
public class Bench
{
int[] arr1 = new int[1024];
int[] arr2 = new int[1024];
[Benchmark]
public void Reverse() =>
BinaryPrimitives.ReverseEndianness(arr1, arr2);
}
@EgorBot -intel --envvars DOTNET_JitDisasm:TernLog --runtimes net8.0 net9.0