Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EgorBot for EgorBo in #112060 #288

Open
EgorBot opened this issue Feb 6, 2025 · 3 comments
Open

EgorBot for EgorBo in #112060 #288

EgorBot opened this issue Feb 6, 2025 · 3 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented Feb 6, 2025

Processing dotnet/runtime#112060 (comment) command:

Command

-arm -amd -windows_intel

using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

// Structs with GC references
[InlineArray(128)] struct StructGC_1024B { object _; }
[InlineArray(32)] struct StructGC_256B { object _; }
[InlineArray(16)] struct StructGC_128B { object _; }
[InlineArray(8)] struct StructGC_64B { object _; }
[InlineArray(4)] struct StructGC_32B { object _; }

// Structs without GC references
[InlineArray(128)] struct StructNoGC_1024B { long _; }
[InlineArray(32)] struct StructNoGC_256B { long _; }
[InlineArray(16)] struct StructNoGC_128B { long _; }
[InlineArray(8)] struct StructNoGC_64B { long _; }
[InlineArray(4)] struct StructNoGC_32B { long _; }

static class Utils
{
    [MethodImpl(MethodImplOptions.NoInlining)]
    public static T Create<T>() where T : struct => default;
    [MethodImpl(MethodImplOptions.NoInlining)]
    public static T Create<T>(T copy) where T : struct => copy;
}

public class WorstCaseBenchmarks
{
    object boxedStruct;

    [Benchmark] public void Box_StructGC_1024B() => boxedStruct = Utils.Create<StructGC_1024B>();
    [Benchmark] public void Box_StructGC_256B() => boxedStruct = Utils.Create<StructGC_256B>();
    [Benchmark] public void Box_StructGC_128B() => boxedStruct = Utils.Create<StructGC_128B>();
    [Benchmark] public void Box_StructGC_64B() => boxedStruct = Utils.Create<StructGC_64B>();
    [Benchmark] public void Box_StructGC_32B() => boxedStruct = Utils.Create<StructGC_32B>();

    [Benchmark] public void Box_StructNoGC_1024B() => boxedStruct = Utils.Create<StructNoGC_1024B>();
    [Benchmark] public void Box_StructNoGC_256B() => boxedStruct = Utils.Create<StructNoGC_256B>();
    [Benchmark] public void Box_StructNoGC_128B() => boxedStruct = Utils.Create<StructNoGC_128B>();
    [Benchmark] public void Box_StructNoGC_64B() => boxedStruct = Utils.Create<StructNoGC_64B>();
    [Benchmark] public void Box_StructNoGC_32B() => boxedStruct = Utils.Create<StructNoGC_32B>();
}
public class BestCaseBenchmarks
{
    [Benchmark] public void Stack_StructGC_1024B() => _ = Utils.Create<StructGC_1024B>(default);
    [Benchmark] public void Stack_StructGC_256B() => _ = Utils.Create<StructGC_256B>(default);
    [Benchmark] public void Stack_StructGC_128B() => _ = Utils.Create<StructGC_128B>(default);
    [Benchmark] public void Stack_StructGC_64B() => _ = Utils.Create<StructGC_64B>(default);
    [Benchmark] public void Stack_StructGC_32B() => _ = Utils.Create<StructGC_32B>(default);

    [Benchmark] public void Stack_StructNoGC_1024B() => _ = Utils.Create<StructNoGC_1024B>(default);
    [Benchmark] public void Stack_StructNoGC_256B() => _ = Utils.Create<StructNoGC_256B>(default);
    [Benchmark] public void Stack_StructNoGC_128B() => _ = Utils.Create<StructNoGC_128B>(default);
    [Benchmark] public void Stack_StructNoGC_64B() => _ = Utils.Create<StructNoGC_64B>(default);
    [Benchmark] public void Stack_StructNoGC_32B() => _ = Utils.Create<StructNoGC_32B>(default);
}

(EgorBot will reply in this issue)

@EgorBot
Copy link
Owner Author

EgorBot commented Feb 6, 2025

Benchmark results on linux_azure_genoa

BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
AMD EPYC 9V74, 1 CPU, 16 logical and 8 physical cores
  Job-TLSEBA : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-MZFSQX : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain Mean Error Ratio
Stack_StructGC_1024B Main 76.471 ns 0.0283 ns 1.00
Stack_StructGC_1024B PR 76.493 ns 0.0472 ns 1.00
Stack_StructGC_256B Main 19.061 ns 0.4095 ns 1.00
Stack_StructGC_256B PR 15.880 ns 0.1483 ns 0.83
Stack_StructGC_128B Main 11.106 ns 0.0150 ns 1.00
Stack_StructGC_128B PR 10.861 ns 0.1518 ns 0.98
Stack_StructGC_64B Main 8.225 ns 0.0371 ns 1.00
Stack_StructGC_64B PR 8.318 ns 0.0819 ns 1.01
Stack_StructGC_32B Main 6.764 ns 0.0007 ns 1.00
Stack_StructGC_32B PR 6.304 ns 0.1304 ns 0.93
Stack_StructNoGC_1024B Main 26.796 ns 0.0773 ns 1.00
Stack_StructNoGC_1024B PR 27.334 ns 0.0500 ns 1.02
Stack_StructNoGC_256B Main 13.408 ns 0.2789 ns 1.00
Stack_StructNoGC_256B PR 10.994 ns 0.1323 ns 0.82
Stack_StructNoGC_128B Main 8.565 ns 0.1894 ns 1.00
Stack_StructNoGC_128B PR 7.848 ns 0.1130 ns 0.92
Stack_StructNoGC_64B Main 7.121 ns 0.0506 ns 1.00
Stack_StructNoGC_64B PR 6.691 ns 0.0594 ns 0.94
Stack_StructNoGC_32B Main 5.984 ns 0.0213 ns 1.00
Stack_StructNoGC_32B PR 5.671 ns 0.0014 ns 0.95
BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
AMD EPYC 9V74, 1 CPU, 16 logical and 8 physical cores
  Job-TLSEBA : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-MZFSQX : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain Mean Error Ratio
Box_StructGC_1024B Main 102.576 ns 0.2461 ns 1.00
Box_StructGC_1024B PR 127.747 ns 0.1796 ns 1.25
Box_StructGC_256B Main 30.564 ns 0.1157 ns 1.00
Box_StructGC_256B PR 40.379 ns 0.1111 ns 1.32
Box_StructGC_128B Main 10.641 ns 0.0205 ns 1.00
Box_StructGC_128B PR 19.348 ns 0.0739 ns 1.82
Box_StructGC_64B Main 9.348 ns 0.0980 ns 1.00
Box_StructGC_64B PR 16.057 ns 0.0137 ns 1.72
Box_StructGC_32B Main 8.496 ns 0.0156 ns 1.00
Box_StructGC_32B PR 15.648 ns 0.1196 ns 1.84
Box_StructNoGC_1024B Main 36.648 ns 0.0364 ns 1.00
Box_StructNoGC_1024B PR 48.320 ns 0.0859 ns 1.32
Box_StructNoGC_256B Main 13.738 ns 0.0280 ns 1.00
Box_StructNoGC_256B PR 19.496 ns 0.0505 ns 1.42
Box_StructNoGC_128B Main 10.585 ns 0.0891 ns 1.00
Box_StructNoGC_128B PR 13.629 ns 0.0513 ns 1.29
Box_StructNoGC_64B Main 8.826 ns 0.0573 ns 1.00
Box_StructNoGC_64B PR 11.600 ns 0.0181 ns 1.31
Box_StructNoGC_32B Main 7.768 ns 0.1032 ns 1.00
Box_StructNoGC_32B PR 9.127 ns 0.0701 ns 1.18

BDN_Artifacts.zip

cc @EgorBo (agent_logs.txt). EgorBot manual: link.

@EgorBot
Copy link
Owner Author

EgorBot commented Feb 6, 2025

Benchmark results on linux_azure_cobalt100

BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
azure_cobalt100
  Job-QCOWRO : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-STCMWI : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method Toolchain Mean Error Ratio
Stack_StructGC_1024B Main 35.1616 ns 0.0527 ns 1.00
Stack_StructGC_1024B PR 31.7411 ns 0.0460 ns 0.90
Stack_StructGC_256B Main 13.0339 ns 0.0385 ns 1.00
Stack_StructGC_256B PR 12.3410 ns 0.0005 ns 0.95
Stack_StructGC_128B Main 7.4219 ns 0.0015 ns 1.00
Stack_StructGC_128B PR 9.2321 ns 0.0008 ns 1.24
Stack_StructGC_64B Main 5.0409 ns 0.0039 ns 1.00
Stack_StructGC_64B PR 3.7991 ns 0.0126 ns 0.75
Stack_StructGC_32B Main 4.2043 ns 0.0012 ns 1.00
Stack_StructGC_32B PR 2.0943 ns 0.0175 ns 0.50
Stack_StructNoGC_1024B Main 25.6441 ns 0.0101 ns 1.00
Stack_StructNoGC_1024B PR 22.7353 ns 0.0299 ns 0.89
Stack_StructNoGC_256B Main 10.4698 ns 0.0031 ns 1.00
Stack_StructNoGC_256B PR 13.2938 ns 0.0013 ns 1.27
Stack_StructNoGC_128B Main 2.7690 ns 0.0014 ns 1.00
Stack_StructNoGC_128B PR 2.7361 ns 0.0022 ns 0.99
Stack_StructNoGC_64B Main 2.5151 ns 0.0341 ns 1.00
Stack_StructNoGC_64B PR 2.3233 ns 0.0755 ns 0.92
Stack_StructNoGC_32B Main 0.8088 ns 0.0120 ns 1.00
Stack_StructNoGC_32B PR 1.4287 ns 0.0076 ns 1.77
BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
azure_cobalt100
  Job-QCOWRO : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-STCMWI : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method Toolchain Mean Error Ratio
Box_StructGC_1024B Main 79.112 ns 0.3550 ns 1.00
Box_StructGC_1024B PR 108.976 ns 0.1131 ns 1.38
Box_StructGC_256B Main 16.887 ns 0.0254 ns 1.00
Box_StructGC_256B PR 31.530 ns 0.0316 ns 1.87
Box_StructGC_128B Main 11.258 ns 0.1688 ns 1.00
Box_StructGC_128B PR 22.055 ns 0.0168 ns 1.96
Box_StructGC_64B Main 8.504 ns 0.0085 ns 1.00
Box_StructGC_64B PR 17.273 ns 0.0132 ns 2.03
Box_StructGC_32B Main 7.080 ns 0.0077 ns 1.00
Box_StructGC_32B PR 15.563 ns 0.0277 ns 2.20
Box_StructNoGC_1024B Main 55.116 ns 0.5849 ns 1.00
Box_StructNoGC_1024B PR 70.465 ns 0.0778 ns 1.28
Box_StructNoGC_256B Main 17.601 ns 0.0285 ns 1.00
Box_StructNoGC_256B PR 24.469 ns 0.0191 ns 1.39
Box_StructNoGC_128B Main 11.223 ns 0.0176 ns 1.00
Box_StructNoGC_128B PR 14.068 ns 0.0168 ns 1.25
Box_StructNoGC_64B Main 8.415 ns 0.0079 ns 1.00
Box_StructNoGC_64B PR 9.874 ns 0.0110 ns 1.17
Box_StructNoGC_32B Main 7.308 ns 0.0109 ns 1.00
Box_StructNoGC_32B PR 7.788 ns 0.0157 ns 1.07

BDN_Artifacts.zip

cc @EgorBo (agent_logs.txt). EgorBot manual: link.

@EgorBot
Copy link
Owner Author

EgorBot commented Feb 6, 2025

Benchmark results on windows_azure_cascadelake

BenchmarkDotNet v0.14.0, Windows 11 (10.0.26100.2314) (Hyper-V)
azure_cascadelake
  Job-XGCJZT : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-KBMLEI : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Job Toolchain Mean Error Ratio
Stack_StructGC_1024B Job-XGCJZT \core_root_base\corerun.exe 37.408 ns 0.0350 ns 1.00
Stack_StructGC_1024B Job-KBMLEI \core_root_diff\corerun.exe 47.993 ns 0.0869 ns 1.28
Stack_StructGC_256B Job-XGCJZT \core_root_base\corerun.exe 14.894 ns 0.3343 ns 1.00
Stack_StructGC_256B Job-KBMLEI \core_root_diff\corerun.exe 9.897 ns 0.0341 ns 0.67
Stack_StructGC_128B Job-XGCJZT \core_root_base\corerun.exe 9.428 ns 0.0366 ns 1.00
Stack_StructGC_128B Job-KBMLEI \core_root_diff\corerun.exe 7.360 ns 0.0060 ns 0.78
Stack_StructGC_64B Job-XGCJZT \core_root_base\corerun.exe 6.565 ns 0.0017 ns 1.00
Stack_StructGC_64B Job-KBMLEI \core_root_diff\corerun.exe 5.879 ns 0.0025 ns 0.90
Stack_StructGC_32B Job-XGCJZT \core_root_base\corerun.exe 5.883 ns 0.0068 ns 1.00
Stack_StructGC_32B Job-KBMLEI \core_root_diff\corerun.exe 4.775 ns 0.0069 ns 0.81
Stack_StructNoGC_1024B Job-XGCJZT \core_root_base\corerun.exe 19.913 ns 0.0198 ns 1.00
Stack_StructNoGC_1024B Job-KBMLEI \core_root_diff\corerun.exe 20.159 ns 0.0123 ns 1.01
Stack_StructNoGC_256B Job-XGCJZT \core_root_base\corerun.exe 7.652 ns 0.0033 ns 1.00
Stack_StructNoGC_256B Job-KBMLEI \core_root_diff\corerun.exe 7.346 ns 0.0086 ns 0.96
Stack_StructNoGC_128B Job-XGCJZT \core_root_base\corerun.exe 6.175 ns 0.0030 ns 1.00
Stack_StructNoGC_128B Job-KBMLEI \core_root_diff\corerun.exe 6.452 ns 0.0031 ns 1.04
Stack_StructNoGC_64B Job-XGCJZT \core_root_base\corerun.exe 5.568 ns 0.0049 ns 1.00
Stack_StructNoGC_64B Job-KBMLEI \core_root_diff\corerun.exe 5.292 ns 0.0053 ns 0.95
Stack_StructNoGC_32B Job-XGCJZT \core_root_base\corerun.exe 4.756 ns 0.0026 ns 1.00
Stack_StructNoGC_32B Job-KBMLEI \core_root_diff\corerun.exe 4.736 ns 0.0022 ns 1.00
BenchmarkDotNet v0.14.0, Windows 11 (10.0.26100.2314) (Hyper-V)
azure_cascadelake
  Job-XGCJZT : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-KBMLEI : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Job Toolchain Mean Error Ratio
Box_StructGC_1024B Job-XGCJZT \core_root_base\corerun.exe 117.369 ns 2.3633 ns 1.00
Box_StructGC_1024B Job-KBMLEI \core_root_diff\corerun.exe 178.364 ns 3.6106 ns 1.52
Box_StructGC_256B Job-XGCJZT \core_root_base\corerun.exe 42.129 ns 0.8746 ns 1.00
Box_StructGC_256B Job-KBMLEI \core_root_diff\corerun.exe 51.762 ns 0.9669 ns 1.23
Box_StructGC_128B Job-XGCJZT \core_root_base\corerun.exe 13.814 ns 0.3111 ns 1.00
Box_StructGC_128B Job-KBMLEI \core_root_diff\corerun.exe 23.971 ns 0.5169 ns 1.74
Box_StructGC_64B Job-XGCJZT \core_root_base\corerun.exe 11.112 ns 0.2621 ns 1.00
Box_StructGC_64B Job-KBMLEI \core_root_diff\corerun.exe 16.475 ns 0.3639 ns 1.48
Box_StructGC_32B Job-XGCJZT \core_root_base\corerun.exe 8.416 ns 0.1984 ns 1.00
Box_StructGC_32B Job-KBMLEI \core_root_diff\corerun.exe 13.515 ns 0.3104 ns 1.61
Box_StructNoGC_1024B Job-XGCJZT \core_root_base\corerun.exe 65.557 ns 1.4757 ns 1.00
Box_StructNoGC_1024B Job-KBMLEI \core_root_diff\corerun.exe 77.784 ns 1.6011 ns 1.19
Box_StructNoGC_256B Job-XGCJZT \core_root_base\corerun.exe 21.318 ns 0.7436 ns 1.01
Box_StructNoGC_256B Job-KBMLEI \core_root_diff\corerun.exe 24.960 ns 0.6324 ns 1.18
Box_StructNoGC_128B Job-XGCJZT \core_root_base\corerun.exe 12.129 ns 0.2816 ns 1.00
Box_StructNoGC_128B Job-KBMLEI \core_root_diff\corerun.exe 12.867 ns 0.3128 ns 1.06
Box_StructNoGC_64B Job-XGCJZT \core_root_base\corerun.exe 9.091 ns 0.2221 ns 1.00
Box_StructNoGC_64B Job-KBMLEI \core_root_diff\corerun.exe 9.060 ns 0.2151 ns 1.00
Box_StructNoGC_32B Job-XGCJZT \core_root_base\corerun.exe 7.469 ns 0.1865 ns 1.00
Box_StructNoGC_32B Job-KBMLEI \core_root_diff\corerun.exe 7.100 ns 0.1822 ns 0.95

BDN_Artifacts.zip

cc @EgorBo (agent_logs.txt). EgorBot manual: link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant