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 #110824 #210

Open
EgorBot opened this issue Dec 19, 2024 · 2 comments
Open

EgorBot for EgorBo in #110824 #210

EgorBot opened this issue Dec 19, 2024 · 2 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented Dec 19, 2024

Processing dotnet/runtime#110824 (comment) command:

Command

-amd -arm

using System.Net;
using BenchmarkDotNet.Attributes;

[MemoryDiagnoser]
public class IPAddressBenchmarks
{
    static IPAddress Ipv6_1 = IPAddress.Parse("3cca:65e1:957d:e712:1c8c:ec01:6d44:febc");
    static IPAddress Ipv6_2 = IPAddress.Parse("3cca:65e1:957d:e712:1c8c:ec01:6d44:febc");
    static IPAddress Ipv6_3 = IPAddress.Parse("17e1:891a:1a00:d475:92cd:d4c7:5b30:775a");
    static IPAddress Ipv6_4 = IPAddress.Parse("33.55.77.99").MapToIPv6();
    static IPAddress Ipv4_1 = IPAddress.Parse("33.55.77.99");
    static byte[] _buffer = new byte[16];

    [Benchmark]
    public bool CompareSameIPv6() => Ipv6_1.Equals(Ipv6_2);

    [Benchmark]
    public bool CompareDifferentIPv6() => Ipv6_1.Equals(Ipv6_3);

    [Benchmark]
    public IPAddress MapToIPv6() => Ipv4_1.MapToIPv6();

    [Benchmark]
    public bool IsIPv4MappedToIPv6() => Ipv6_4.IsIPv4MappedToIPv6;

    [Benchmark]
    public bool TryWriteBytes_v6() => Ipv6_1.TryWriteBytes(_buffer, out _);

    [Benchmark]
    public IPAddress NewIPAddressv6() => new("1111222233334444"u8);

    [Benchmark]
    public IPAddress ParseIPAddressv6() => IPAddress.Parse("3cca:65e1:957d:e712:1c8c:ec01:6d44:febc");
}

(EgorBot will reply in this issue)

@EgorBot
Copy link
Owner Author

EgorBot commented Dec 19, 2024

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-PQZILB : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-FAJUAN : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain Mean Error Ratio Gen0 Allocated Alloc Ratio
CompareSameIPv6 Main 2.7485 ns 0.0119 ns 1.00 - - NA
CompareSameIPv6 PR 2.2361 ns 0.0069 ns 0.81 - - NA
CompareDifferentIPv6 Main 1.6495 ns 0.0004 ns 1.00 - - NA
CompareDifferentIPv6 PR 2.0778 ns 0.0003 ns 1.26 - - NA
MapToIPv6 Main 12.3978 ns 0.1250 ns 1.00 0.0048 80 B 1.00
MapToIPv6 PR 12.4839 ns 0.2900 ns 1.01 0.0048 80 B 1.00
IsIPv4MappedToIPv6 Main 0.8163 ns 0.0051 ns 1.00 - - NA
IsIPv4MappedToIPv6 PR 0.5451 ns 0.0002 ns 0.67 - - NA
TryWriteBytes_v6 Main 1.6351 ns 0.0003 ns 1.00 - - NA
TryWriteBytes_v6 PR 1.6354 ns 0.0006 ns 1.00 - - NA
NewIPAddressv6 Main 13.2638 ns 0.1007 ns 1.00 0.0048 80 B 1.00
NewIPAddressv6 PR 13.2176 ns 0.0543 ns 1.00 0.0048 80 B 1.00
ParseIPAddressv6 Main 119.4336 ns 0.0621 ns 1.00 0.0048 80 B 1.00
ParseIPAddressv6 PR 119.6042 ns 0.0468 ns 1.00 0.0048 80 B 1.00

BDN_Artifacts.zip

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

@EgorBot
Copy link
Owner Author

EgorBot commented Dec 19, 2024

Benchmark results on linux_azure_cobalt100

BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
azure_cobalt100
  Job-MEPAFM : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-FAFQDL : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method Toolchain Mean Error Ratio Gen0 Allocated Alloc Ratio
CompareSameIPv6 Main 2.8912 ns 0.0016 ns 1.00 - - NA
CompareSameIPv6 PR 1.7848 ns 0.0008 ns 0.62 - - NA
CompareDifferentIPv6 Main 1.8751 ns 0.0009 ns 1.00 - - NA
CompareDifferentIPv6 PR 1.5582 ns 0.0015 ns 0.83 - - NA
MapToIPv6 Main 16.0989 ns 0.1831 ns 1.00 0.0012 80 B 1.00
MapToIPv6 PR 16.4211 ns 0.0259 ns 1.02 0.0012 80 B 1.00
IsIPv4MappedToIPv6 Main 0.3076 ns 0.0003 ns 1.00 - - NA
IsIPv4MappedToIPv6 PR 0.8312 ns 0.0006 ns 2.70 - - NA
TryWriteBytes_v6 Main 0.5684 ns 0.0047 ns 1.00 - - NA
TryWriteBytes_v6 PR 0.4598 ns 0.0666 ns 0.81 - - NA
NewIPAddressv6 Main 15.5508 ns 0.0778 ns 1.00 0.0012 80 B 1.00
NewIPAddressv6 PR 15.5550 ns 0.0452 ns 1.00 0.0012 80 B 1.00
ParseIPAddressv6 Main 163.4556 ns 0.0370 ns 1.00 0.0012 80 B 1.00
ParseIPAddressv6 PR 163.5349 ns 0.1217 ns 1.00 0.0012 80 B 1.00

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