EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for EgorBo in #107869 #90

Open EgorBot opened 2 months ago

EgorBot commented 2 months ago

Processing https://github.com/dotnet/runtime/issues/107869#issuecomment-2353135259 command:

Command -intel --runtimes net8.0 net9.0 ```cs using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text.Json.Nodes; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; using BenchmarkDotNet.Diagnosers; BenchmarkRunner.Run(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 will reply in this issue)

EgorBot commented 2 months ago

Benchmark results on 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-FOAJRE : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-CZZDTP : .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 466.3 ns 5.04 ns 1.00 0.0505 1.24 KB 1.00
CreateJsonObject .NET 9.0 896.4 ns 5.71 ns 1.92 0.0858 2.12 KB 1.70

BDN_Artifacts.zip

EgorBot commented 2 months ago

cc @EgorBo (logs)