EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for EgorBo in #9 #10

Open EgorBot opened 2 months ago

EgorBot commented 2 months ago

Processing https://github.com/EgorBot/runtime-utils/issues/9#issuecomment-2323424050:


-pr 107116 -perf

using BenchmarkDotNet.Attributes;
using System.Collections.Generic;

public sealed class SealedClass {}

public class Bench
{
    SealedClass _bench = new();
    List<SealedClass> _list = new() { null };

    [Benchmark]
    public void Test() => _list[0] = _bench;
}
EgorBot commented 2 months ago

Benchmark results on Intel

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-WTBBHF : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-LMRNGZ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain Mean Error Ratio
Test Main 4.454 ns 0.0133 ns 1.00
Test PR 2.839 ns 0.0086 ns 0.64

BDN_Artifacts.zip

EgorBot commented 2 months ago

Build log

cc @EgorBo