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 #109428 #144

Closed
EgorBot opened this issue Nov 1, 2024 · 62 comments
Closed

EgorBot for EgorBo in #109428 #144

EgorBot opened this issue Nov 1, 2024 · 62 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented Nov 1, 2024

Processing dotnet/runtime#109428 (comment) command:

Command

-arm64 -profiler

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

(EgorBot will reply in this issue)

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 1, 2024

Benchmark results on Arm64

BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
Arm64
  Job-HBOXFZ : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-TLGBNY : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method Toolchain Mean Error Ratio
Bench Main 3.067 ns 0.0003 ns 1.00
Bench PR 3.224 ns 0.0007 ns 1.05

BDN_Artifacts.zip

Profile for Bencha_Bench:

Flame graphs: Main vs PR 🔥
Speedscope: Main vs PR
Hot asm: Main vs PR
Hot functions: Main vs PR
Counters: Main vs PR

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 1, 2024

cc @EgorBo (logs)

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

3 similar comments
@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

Benchmark results on AwsGenoa

BenchmarkDotNet v0.14.0, Windows 10 (10.0.20348.2762)
AMD EPYC 9R14, 1 CPU, 16 logical and 16 physical cores
DefaultJob : .NET 9.0.0 (9.0.24.47305), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
StdDev=0.0180 ns
Method Mean Error
Bench 2.691 ns 0.0193 ns

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo (logs)

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

1 similar comment
@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

Benchmark results on Windows-Genoa

BenchmarkDotNet v0.14.0, Windows 10 (10.0.20348.2762)
AMD EPYC 9R14, 1 CPU, 16 logical and 16 physical cores
  Job-HYEZIP : .NET 8.0.10 (8.0.1024.46610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-HAATBL : .NET 9.0.0 (9.0.24.47305), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Runtime Mean Error Ratio
Bench .NET 8.0 7.581 ns 0.0006 ns 1.00
Bench .NET 9.0 2.680 ns 0.0103 ns 0.35

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo (logs)

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;

public class Bencha
{
    seetatic object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

1 similar comment
@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;

public class Bencha
{
    seetatic object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

❌ Failed on AwsGenoa: Job failed, see logs.

cc @EgorBo (logs)

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

❌ Failed on AwsGenoa: Job failed, see logs.

cc @EgorBo (logs)

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

1 similar comment
@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

Benchmark results on Windows-Genoa

BenchmarkDotNet v0.14.0, Windows 10 (10.0.20348.2762)
AMD EPYC 9R14, 1 CPU, 16 logical and 16 physical cores
  Job-FTJCUF : .NET 8.0.10 (8.0.1024.46610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-JAXQST : .NET 9.0.0 (9.0.24.47305), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Runtime Mean Error Ratio
Bench .NET 8.0 7.588 ns 0.0037 ns 1.00
Bench .NET 9.0 2.680 ns 0.0098 ns 0.35

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo (logs)

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;

public class Bencha
{
    statlllic object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

❌ Failed on AwsGenoa: Job failed, see logs.

cc @EgorBo (logs)

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_arm64 --runtimes net8.0 net9.0

using BenchmarkDotNet.Attributes;

public class Bencha
{
    static object obj = new MyClass();

    [Benchmark]
    public void Bench()
    {
        if (obj is MyClass myClass1)
            myClass1.DoWork();
        if (obj is MyClass myClass2)
            myClass2.DoWork();
        if (obj is MyClass myClass3)
            myClass3.DoWork();
        if (obj is MyClass myClass4)
            myClass4.DoWork();
        if (obj is MyClass myClass5)
            myClass5.DoWork();
        if (obj is MyClass myClass6)
            myClass6.DoWork();
    }
}

public class MyClass {
    public virtual void DoWork() {}
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

❌ AwsGraviton4 can't be used with OS=Windows2022. See:

[azure_ampere] = [ubuntu2204, ubuntu2404],
[azure_milano] = [ubuntu2204, ubuntu2404],
[azure_icelake] = [ubuntu2204, ubuntu2404],
[azure_cobalt100] = [ubuntu2204, ubuntu2404],
[azure_genoa] = [ubuntu2204, ubuntu2404],
[aws_graviton2] = [ubuntu2204, ubuntu2404],
[aws_graviton3] = [ubuntu2204, ubuntu2404],
[aws_graviton4] = [ubuntu2204, ubuntu2404],
[aws_m2pro] = [macos],
[aws_m1] = [macos],
[aws_m1ultra] = [macos],
[aws_m2] = [macos],
[aws_macx86] = [macos],
[aws_sapphirelake] = [windows, ubuntu2204, ubuntu2404],
[aws_icelake] = [windows, ubuntu2204, ubuntu2404],
[aws_genoa] = [windows, ubuntu2204, ubuntu2404],
[aws_milano] = [windows, ubuntu2204, ubuntu2404],

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo

@EgorBot EgorBot closed this as completed Nov 3, 2024
@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd -pr 109466

using BenchmarkDotNet.Attributes;

public class C
{
    private static readonly int[] _perm = [1, 2, 3, 4];

    private int Index = 1;

    [Benchmark]
    public int Hash()
    {
        int index = Index;
        return _perm[index & (_perm.Length - 1)];
    }
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

❌ Failed on AwsGenoa: Job failed, see logs.

cc @EgorBo (logs)

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -linux_amd -arm64 -pr 109466

using BenchmarkDotNet.Attributes;

public class C
{
    private static readonly int[] _perm = [1, 2, 3, 4];

    private int Index = 1;

    [Benchmark]
    public int Hash()
    {
        int index = Index;
        return _perm[index & (_perm.Length - 1)];
    }
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

Benchmark results on Linux-Genoa

BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
AMD EPYC 9R14, 1 CPU, 16 logical and 16 physical cores
  Job-VHFPFT : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-LKZIRQ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain Mean Error Ratio
Hash Main 0.2789 ns 0.0191 ns 1.00
Hash PR 0.0112 ns 0.0118 ns 0.04

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo (logs)

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

Benchmark results on Linux-Graviton4

BenchmarkDotNet v0.14.0, Ubuntu 24.04 LTS (Noble Numbat)
Arm64
  Job-DHKDWN : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-NWKPCJ : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method Toolchain Mean Error Ratio
Hash Main 0.1383 ns 0.0012 ns 1.00
Hash PR 0.1162 ns 0.0016 ns 0.84

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo (logs)

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

Benchmark results on Windows-Genoa

BenchmarkDotNet v0.14.0, Windows 10 (10.0.20348.2762)
AMD EPYC 9R14, 1 CPU, 16 logical and 16 physical cores
  Job-MWHTTU : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
RatioSD=?
Method Job Toolchain Mean Error Ratio
Hash Job-NQEOWI \core_root_base\corerun.exe NA NA ?
Hash Job-MWHTTU \core_root_diff\corerun.exe 0.0022 ns 0.0026 ns ?
Benchmarks with issues:
C.Hash: Job-NQEOWI(Toolchain=\core_root_base\corerun.exe)

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo (logs)

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_amd -pr 109466

using BenchmarkDotNet.Attributes;

public class C
{
    private static readonly int[] _perm = [1, 2, 3, 4];

    private int Index = 1;

    [Benchmark]
    public int Hash()
    {
        int index = Index;
        return _perm[index & (_perm.Length - 1)];
    }
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

Benchmark results on Windows-Genoa

BenchmarkDotNet v0.14.0, Windows 10 (10.0.20348.2762)
AMD EPYC 9R14, 1 CPU, 16 logical and 16 physical cores
  Job-FETNAZ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-HGBNVG : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Job Toolchain Mean Error Ratio
Hash Job-FETNAZ \core_root_base\corerun.exe 0.2753 ns 0.0077 ns 1.001
Hash Job-HGBNVG \core_root_diff\corerun.exe 0.0001 ns 0.0005 ns 0.000

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo (logs)

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_arm -pr 109466

using BenchmarkDotNet.Attributes;

public class C
{
    private static readonly int[] _perm = [1, 2, 3, 4];

    private int Index = 1;

    [Benchmark]
    public int Hash()
    {
        int index = Index;
        return _perm[index & (_perm.Length - 1)];
    }
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

❌ AwsGraviton4 can't be used with OS=Windows2022. See:

[azure_ampere] = [ubuntu2204, ubuntu2404],
[azure_milano] = [ubuntu2204, ubuntu2404],
[azure_icelake] = [ubuntu2204, ubuntu2404],
[azure_cobalt100] = [ubuntu2204, ubuntu2404],
[azure_genoa] = [ubuntu2204, ubuntu2404],
[aws_graviton2] = [ubuntu2204, ubuntu2404],
[aws_graviton3] = [ubuntu2204, ubuntu2404],
[aws_graviton4] = [ubuntu2204, ubuntu2404],
[aws_m2pro] = [macos],
[aws_m1] = [macos],
[aws_m1ultra] = [macos],
[aws_m2] = [macos],
[aws_macx86] = [macos],
[aws_sapphirelake] = [windows, ubuntu2204, ubuntu2404],
[aws_icelake] = [windows, ubuntu2204, ubuntu2404],
[aws_genoa] = [windows, ubuntu2204, ubuntu2404],
[aws_milano] = [windows, ubuntu2204, ubuntu2404],

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_arm -pr 109466

using BenchmarkDotNet.Attributes;

public class C
{
    private static readonly int[] _perm = [1, 2, 3, 4];

    private int Index = 1;

    [Benchmark]
    public int Hash()
    {
        int index = Index;
        return _perm[index & (_perm.Length - 1)];
    }
}

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -help

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

❌ AwsGraviton4 can't be used with OS=Windows2022. See:

Targets:             OSes:

azure_ampere         linux
azure_milano         linux
azure_icelake        linux
azure_cobalt100      linux
azure_genoa          linux
aws_m1               macos
aws_m1ultra          macos
aws_m2               macos
aws_m2pro            macos
aws_macx86           macos
aws_sapphirelake     linux, windows
aws_icelake          linux, windows
aws_genoa            linux, windows
aws_milano           linux, windows

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

EgorBot manual

Usage: @EgorBot [-%target%] [-profiler] [raw args for BDN] `C# snippet surrounded with triple ticks`
-%target%:       Can be -arm, -amd or -intel. Or multiple at once, e.g. '-arm64 -intel'
                 -intel is used when none of the targets are specified.

                 NOTE: target can be prefixed with the OS:
                  -linux_*
                  -windows_*              (x64 only atm)
                  -macos_*                (temporarily disabled)

                 Full list of targets (idiomatic names):
                  -azure_ampere           (temporarily disabled)
                  -azure_cobalt100        (temporarily disabled)
                  -azure_milano           (temporarily disabled)
                  -azure_icelake          (temporarily disabled)
                  -aws_sapphirelake
                  -aws_icelake
                  -aws_genoa
                  -aws_milano
                  -aws_m1                 (temporarily disabled)
                  -aws_m1ultra            (temporarily disabled)
                  -aws_m2                 (temporarily disabled)
                  -aws_m2pro              (temporarily disabled)
                  
                  short aliases:
                  -arm   = -azure_ampere  (temporarily changed to -aws_graviton4)
                  -intel = -azure_icelake (temporarily changed to -aws_sapphirelake)
                  -amd   = -azure_milano  (temporarily changed to -aws_genoa)

-profiler:       Use 'perf record' to collect a flamegraph/hot asm.
                 
-perf_events     Exact events to collect with 'perf', e.g. -perf_events ld_align_lat
                 (events are target-specific, you can find the list of the supported events in BDN_Artifacts.zip
                 when you run a benchmark with -profiler arg).

-commit:         E.g. '-commit 72ea87f vs 380898a' or just '-commit 72ea87f'
                 Runs the benchmark on the specified commit(s) (PR is ignored)

-mono:           Use Mono runtime instead of CoreCLR for all targets. Should be possible to use
                 Mono interp too (LLVM is not supported yet).
                 Mono doesn't support -profiler (at least JIT)
                 To use mono-interp, use BDN args, e.g. --envvars MONO_ENV_OPTIONS:"--interpreter"
                 
-nonativepgo:    Disable native PGO (Build with /p:NoPgoOptimize=true)
                 
-pr %num%:       Run for changes in a specific PR. If bot is invoked from a PR - it takes changes
                 from that PR implicitly.

-[args for BDN]: Args directly passed to BDN e.g. '--disasm', see
                 https://github.com/dotnet/BenchmarkDotNet/blob/master/docs/articles/guides/console-args.md

All targets are Linux-only at the moment.
NOTE: BenchmarkRunner.Run or BenchmarkSwitcher.From* can be omitted (snippet without an entrypoint)
Although, if they're presented then Program's args must be be forwarded to Run(args: args)

NOTE: [DisassemblyDiagnoser] may cause unexpected crashes in BDN on Linux (at least on x64)

Examples:
-intel -arm64 -perf --envvars DOTNET_JitDisasm:Foo

Usage example: link

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo

1 similar comment
@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -help

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

EgorBot manual

Usage: @EgorBot [-%targets%] [other EgorBot args] [raw args for BDN] `C# snippet surrounded with triple ticks`
-%target%:       Example: "-arm" or "-intel -arm" or "-windows_x64 -linux_aws_genoa"

                 NOTE: target can be prefixed with the OS:
                  -linux_*
                  -windows_*              (x64 only atm)
                  -macos_*                (temporarily disabled)

                 Full list of targets (idiomatic names):
                  -azure_ampere           (temporarily disabled)
                  -azure_cobalt100        (temporarily disabled)
                  -azure_milano           (temporarily disabled)
                  -azure_icelake          (temporarily disabled)
                  -aws_sapphirelake
                  -aws_icelake
                  -aws_genoa
                  -aws_milano
                  -aws_m1                 (temporarily disabled)
                  -aws_m1ultra            (temporarily disabled)
                  -aws_m2                 (temporarily disabled)
                  -aws_m2pro              (temporarily disabled)
                  
                  short aliases:
                  -arm   = -azure_ampere  (temporarily changed to -aws_graviton4)
                  -intel = -azure_icelake (temporarily changed to -aws_sapphirelake)
                  -amd   = -azure_milano  (temporarily changed to -aws_genoa)

-profiler:       Use 'perf record' to collect a flamegraph/hot asm.
                 
-perf_events     Exact events to collect with 'perf', e.g. -perf_events ld_align_lat
                 (events are target-specific, you can find the list of the supported events in BDN_Artifacts.zip
                 when you run a benchmark with -profiler arg).

-commit:         E.g. '-commit 72ea87f vs 380898a' or just '-commit 72ea87f'
                 Runs the benchmark on the specified commit(s) (PR is ignored)

-mono:           Use Mono runtime instead of CoreCLR for all targets. Should be possible to use
                 Mono interp too (LLVM is not supported yet).
                 Mono doesn't support -profiler (at least JIT)
                 To use mono-interp, use BDN args, e.g. --envvars MONO_ENV_OPTIONS:"--interpreter"
                 
-nonativepgo:    Disable native PGO (Build with /p:NoPgoOptimize=true)
                 
-pr %num%:       Run for changes in a specific PR. If bot is invoked from a PR - it takes changes
                 from that PR implicitly.

-[args for BDN]: Args directly passed to BDN e.g. '--disasm', see
                 https://github.com/dotnet/BenchmarkDotNet/blob/master/docs/articles/guides/console-args.md

NOTE: BenchmarkRunner.Run or BenchmarkSwitcher.From* can be omitted (snippet without an entrypoint)
Although, if they're presented then Program's args must be be forwarded to Run(args: args)

NOTE: Avoid [DisassemblyDiagnoser] - it causes crashes on Linux, better use --envvars DOTNET_JitDisasm:MethodName

Usage example: link

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_arm -pr 109466

using BenchmarkDotNet.Attributes;

public class C
{
    private static readonly int[] _perm = [1, 2, 3, 4];

    private int Index = 1;

    [Benchmark]
    public int Hash()
    {
        int index = Index;
        return _perm[index & (_perm.Length - 1)];
    }
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

AwsGraviton4 can't be used with Windows2022. See:

Targets:             OSes:

azure_ampere         linux
azure_milano         linux
azure_icelake        linux
azure_cobalt100      linux
azure_genoa          linux
aws_m1               macos
aws_m1ultra          macos
aws_m2               macos
aws_m2pro            macos
aws_macx86           macos
aws_sapphirelake     linux, windows
aws_icelake          linux, windows
aws_genoa            linux, windows
aws_milano           linux, windows

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo

@EgorBo
Copy link

EgorBo commented Nov 3, 2024

@EgorBot -win_intel -amd -pr 109466

using BenchmarkDotNet.Attributes;

public class C
{
    private static readonly int[] _perm = [1, 2, 3, 4];

    private int Index = 1;

    [Benchmark]
    public int Hash()
    {
        int index = Index;
        return _perm[index & (_perm.Length - 1)];
    }
}

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

Benchmark results on windows-sapphirelake

BenchmarkDotNet v0.14.0, Windows 10 (10.0.20348.2762)
Intel Xeon Platinum 8488C, 1 CPU, 16 logical and 8 physical cores
  Job-RHQJNR : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-MXTMRG : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Job Toolchain Mean Error Ratio
Hash Job-RHQJNR \core_root_base\corerun.exe 0.0251 ns 0.0382 ns 46.258
Hash Job-MXTMRG \core_root_diff\corerun.exe 0.0000 ns 0.0000 ns 0.000

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo (logs)

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

Benchmark results on windows-genoa

BenchmarkDotNet v0.14.0, Windows 10 (10.0.20348.2762)
AMD EPYC 9R14, 1 CPU, 16 logical and 16 physical cores
  Job-YXVSHO : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-MIKZXI : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Job Toolchain Mean Error Ratio
Hash Job-YXVSHO \core_root_base\corerun.exe 0.2979 ns 0.0185 ns 1.00
Hash Job-MIKZXI \core_root_diff\corerun.exe 0.0088 ns 0.0116 ns 0.03

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Nov 3, 2024

cc @EgorBo (logs)

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

2 participants