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

CI test #99871

Closed
wants to merge 3 commits into from
Closed

CI test #99871

wants to merge 3 commits into from

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Mar 16, 2024

No description provided.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 16, 2024
@dotnet dotnet deleted a comment from EgorBot Mar 16, 2024
@dotnet dotnet deleted a comment from EgorBot Mar 17, 2024
@EgorBo EgorBo closed this Mar 17, 2024
@EgorBo EgorBo reopened this Mar 17, 2024
@EgorBo EgorBo closed this Mar 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2024
@EgorBo EgorBo reopened this May 3, 2024
@dotnet dotnet unlocked this conversation May 3, 2024
@EgorBo EgorBo closed this May 11, 2024
@EgorBo EgorBo reopened this May 18, 2024
@EgorBo EgorBo closed this May 19, 2024
@dotnet dotnet deleted a comment from EgorBot May 19, 2024
@dotnet dotnet deleted a comment from EgorBot May 19, 2024
@dotnet dotnet deleted a comment from EgorBot May 19, 2024
@dotnet dotnet deleted a comment from EgorBot May 19, 2024
@dotnet dotnet deleted a comment from EgorBot May 19, 2024
@dotnet dotnet deleted a comment from EgorBot May 19, 2024
@dotnet dotnet deleted a comment from EgorBot May 19, 2024
@dotnet dotnet deleted a comment from EgorBot May 19, 2024
@EgorBo EgorBo reopened this May 20, 2024
@dotnet dotnet deleted a comment from EgorBot May 20, 2024
@dotnet dotnet deleted a comment from EgorBot May 20, 2024
@dotnet dotnet deleted a comment from EgorBot May 20, 2024
@dotnet dotnet deleted a comment from EgorBot May 20, 2024
@dotnet dotnet deleted a comment from EgorBot May 20, 2024
@dotnet dotnet deleted a comment from EgorBot May 20, 2024
@dotnet dotnet deleted a comment from EgorBot May 20, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@EgorBo
Copy link
Member Author

EgorBo commented Jun 28, 2024

@EgorBot -arm64 -amd -intel

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

BenchmarkRunner.Run<Utf8Bench>(args: args);

public unsafe class Utf8Bench
{
    byte* _ptr1 = null;
    byte* _ptr2 = null;

    [GlobalSetup]
    public void GlobalSetup()
    {
        _ptr1 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64) + 8;
        _ptr2 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64) + 8;
    }

    [GlobalCleanup]
    public void GlobalCleanup()
    {
        NativeMemory.Free(_ptr1);
        NativeMemory.Free(_ptr2);
    }

    public static IEnumerable<long> Sizes()
    {
        yield return       1_000;
        yield return      10_000;
        yield return     100_000;
        yield return   1_000_000;
        yield return  10_000_000;
        yield return 100_000_000;
    }

    [Benchmark]
    [ArgumentsSource(nameof(Sizes))]
    public void Managed(long size) => Buffer.MemoryCopy(_ptr1, _ptr2, size, size);

    [Benchmark]
    [ArgumentsSource(nameof(Sizes))]
    public void Native(long size) => memcpy(_ptr1, _ptr2, (nuint)size);

    [DllImport("libc")]
    static extern nuint memcpy(byte* dest, byte* src, nuint size);
}

@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@dotnet dotnet deleted a comment from EgorBot Jun 28, 2024
@EgorBo
Copy link
Member Author

EgorBo commented Jun 28, 2024

@EgorBot -intel

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

BenchmarkRunner.Run<Utf8Bench>(args: args);

public unsafe class Utf8Bench
{
    byte* _ptr1 = null;
    byte* _ptr2 = null;

    [GlobalSetup]
    public void GlobalSetup()
    {
        _ptr1 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
        _ptr2 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
    }

    [GlobalCleanup]
    public void GlobalCleanup()
    {
        NativeMemory.Free(_ptr1);
        NativeMemory.Free(_ptr2);
    }

    public static IEnumerable<long> Sizes()
    {
        yield return     100_000;
    }

    [Benchmark]
    [ArgumentsSource(nameof(Sizes))]
    public void Managed(long size) => Buffer.MemoryCopy(_ptr1, _ptr2, size, size);
}

4 similar comments
@EgorBo
Copy link
Member Author

EgorBo commented Jun 28, 2024

@EgorBot -intel

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

BenchmarkRunner.Run<Utf8Bench>(args: args);

public unsafe class Utf8Bench
{
    byte* _ptr1 = null;
    byte* _ptr2 = null;

    [GlobalSetup]
    public void GlobalSetup()
    {
        _ptr1 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
        _ptr2 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
    }

    [GlobalCleanup]
    public void GlobalCleanup()
    {
        NativeMemory.Free(_ptr1);
        NativeMemory.Free(_ptr2);
    }

    public static IEnumerable<long> Sizes()
    {
        yield return     100_000;
    }

    [Benchmark]
    [ArgumentsSource(nameof(Sizes))]
    public void Managed(long size) => Buffer.MemoryCopy(_ptr1, _ptr2, size, size);
}

@EgorBo
Copy link
Member Author

EgorBo commented Jun 28, 2024

@EgorBot -intel

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

BenchmarkRunner.Run<Utf8Bench>(args: args);

public unsafe class Utf8Bench
{
    byte* _ptr1 = null;
    byte* _ptr2 = null;

    [GlobalSetup]
    public void GlobalSetup()
    {
        _ptr1 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
        _ptr2 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
    }

    [GlobalCleanup]
    public void GlobalCleanup()
    {
        NativeMemory.Free(_ptr1);
        NativeMemory.Free(_ptr2);
    }

    public static IEnumerable<long> Sizes()
    {
        yield return     100_000;
    }

    [Benchmark]
    [ArgumentsSource(nameof(Sizes))]
    public void Managed(long size) => Buffer.MemoryCopy(_ptr1, _ptr2, size, size);
}

@EgorBo
Copy link
Member Author

EgorBo commented Jun 28, 2024

@EgorBot -intel

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

BenchmarkRunner.Run<Utf8Bench>(args: args);

public unsafe class Utf8Bench
{
    byte* _ptr1 = null;
    byte* _ptr2 = null;

    [GlobalSetup]
    public void GlobalSetup()
    {
        _ptr1 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
        _ptr2 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
    }

    [GlobalCleanup]
    public void GlobalCleanup()
    {
        NativeMemory.Free(_ptr1);
        NativeMemory.Free(_ptr2);
    }

    public static IEnumerable<long> Sizes()
    {
        yield return     100_000;
    }

    [Benchmark]
    [ArgumentsSource(nameof(Sizes))]
    public void Managed(long size) => Buffer.MemoryCopy(_ptr1, _ptr2, size, size);
}

@EgorBo
Copy link
Member Author

EgorBo commented Jun 28, 2024

@EgorBot -intel

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

BenchmarkRunner.Run<Utf8Bench>(args: args);

public unsafe class Utf8Bench
{
    byte* _ptr1 = null;
    byte* _ptr2 = null;

    [GlobalSetup]
    public void GlobalSetup()
    {
        _ptr1 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
        _ptr2 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
    }

    [GlobalCleanup]
    public void GlobalCleanup()
    {
        NativeMemory.Free(_ptr1);
        NativeMemory.Free(_ptr2);
    }

    public static IEnumerable<long> Sizes()
    {
        yield return     100_000;
    }

    [Benchmark]
    [ArgumentsSource(nameof(Sizes))]
    public void Managed(long size) => Buffer.MemoryCopy(_ptr1, _ptr2, size, size);
}

@EgorBot
Copy link

EgorBot commented Jun 28, 2024

❌ Benchmark failed on Intel
publishing results failed

@EgorBo
Copy link
Member Author

EgorBo commented Jun 28, 2024

@EgorBot -intel

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

BenchmarkRunner.Run<Utf8Bench>(args: args);

public unsafe class Utf8Bench
{
    byte* _ptr1 = null;
    byte* _ptr2 = null;

    [GlobalSetup]
    public void GlobalSetup()
    {
        _ptr1 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
        _ptr2 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
    }

    [GlobalCleanup]
    public void GlobalCleanup()
    {
        NativeMemory.Free(_ptr1);
        NativeMemory.Free(_ptr2);
    }

    public static IEnumerable<long> Sizes()
    {
        yield return     100_000;
    }

    [Benchmark]
    [ArgumentsSource(nameof(Sizes))]
    public void Managed(long size) => Buffer.MemoryCopy(_ptr1, _ptr2, size, size);
}

@EgorBot
Copy link

EgorBot commented Jun 28, 2024

❌ Benchmark failed on Intel
publishing results failed

@EgorBo
Copy link
Member Author

EgorBo commented Jun 28, 2024

@EgorBot -intel

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

BenchmarkRunner.Run<Utf8Bench>(args: args);

public unsafe class Utf8Bench
{
    byte* _ptr1 = null;
    byte* _ptr2 = null;

    [GlobalSetup]
    public void GlobalSetup()
    {
        _ptr1 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
        _ptr2 = (byte*)NativeMemory.AlignedAlloc(300 * 1024 * 1024, 64);
    }

    [GlobalCleanup]
    public void GlobalCleanup()
    {
        NativeMemory.Free(_ptr1);
        NativeMemory.Free(_ptr2);
    }

    public static IEnumerable<long> Sizes()
    {
        yield return     100_000;
    }

    [Benchmark]
    [ArgumentsSource(nameof(Sizes))]
    public void Managed(long size) => Buffer.MemoryCopy(_ptr1, _ptr2, size, size);
}

@EgorBot
Copy link

EgorBot commented Jun 28, 2024

Benchmark results on Intel
BenchmarkDotNet v0.13.12, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 8 logical and 4 physical cores
  Job-FRYCZO : .NET 9.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-VHWOZG : .NET 9.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain size Mean Error Ratio
Managed Main 100000 2.167 μs 0.0004 μs 1.00
Managed PR 100000 2.265 μs 0.0002 μs 1.05

BDN_Artifacts.zip

@EgorBo EgorBo closed this Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants