Skip to content

Benchmarks for #116150 (stephentoub) #366

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

Open
EgorBot opened this issue May 30, 2025 · 4 comments
Open

Benchmarks for #116150 (stephentoub) #366

EgorBot opened this issue May 30, 2025 · 4 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented May 30, 2025

Processing dotnet/runtime#116150 (comment) command:

Command

-arm -amd -intel

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

BenchmarkSwitcher.FromAssembly(typeof(Bench).Assembly).Run(args);

[MemoryDiagnoser(false)]
public class Bench
{
    [Benchmark]
    [ArgumentsSource(nameof(GetLists))]
    public int SumList(List<int> list)
    {
        int sum = 0;
        foreach (int item in list)
        {
            sum += item;
        }
        return sum;
    }

    [Benchmark]
    [ArgumentsSource(nameof(GetLists))]
    public int SumEnumerable(IEnumerable<int> list)
    {
        int sum = 0;
        foreach (int item in list)
        {
            sum += item;
        }
        return sum;
    }

    public static IEnumerable<List<int>> GetLists() =>
        from count in new int[] { 1, 10, 1_000 }
        select Enumerable.Range(0, count).ToList();
}

(EgorBot will reply in this issue)

@EgorBot
Copy link
Owner Author

EgorBot commented May 30, 2025

Benchmark results on linux_azure_cobalt100

BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
azure_cobalt100
  Job-BTRMFC : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-ORKJOO : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method Toolchain list Mean Error Ratio Allocated Alloc Ratio
SumList Main Syste(...)nt32] [47] 0.0000 ns 0.0000 ns ? - ?
SumList Main Syste(...)nt32] [47] 4.6874 ns 0.0017 ns ? - ?
SumList Main Syste(...)nt32] [47] 537.1816 ns 0.4504 ns ? - ?
SumList PR Syste(...)nt32] [47] 0.0333 ns 0.0088 ns ? - ?
SumList PR Syste(...)nt32] [47] 5.7169 ns 0.0012 ns ? - ?
SumList PR Syste(...)nt32] [47] 652.1967 ns 0.0367 ns ? - ?
SumEnumerable Main Syste(...)nt32] [47] 0.5323 ns 0.0016 ns 1.00 - NA
SumEnumerable Main Syste(...)nt32] [47] 5.7383 ns 0.0028 ns 10.78 - NA
SumEnumerable Main Syste(...)nt32] [47] 2,009.2064 ns 0.7815 ns 3,774.62 40 B NA
SumEnumerable PR Syste(...)nt32] [47] 0.6626 ns 0.0087 ns 1.24 - NA
SumEnumerable PR Syste(...)nt32] [47] 6.9080 ns 0.0005 ns 12.98 - NA
SumEnumerable PR Syste(...)nt32] [47] 712.4869 ns 0.1232 ns 1,338.52 - NA

BDN_Artifacts.zip

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

@EgorBot
Copy link
Owner Author

EgorBot commented May 30, 2025

Benchmark results on linux_azure_genoa

BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
AMD EPYC 9V74, 1 CPU, 8 logical and 4 physical cores
  Job-CXFGYQ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-ZCTHIR : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain list Mean Error Ratio Allocated Alloc Ratio
SumList Main Syste(...)nt32] [47] 0.2737 ns 0.0006 ns 1.00 - NA
SumList Main Syste(...)nt32] [47] 5.5016 ns 0.0010 ns 20.10 - NA
SumList Main Syste(...)nt32] [47] 550.3681 ns 0.1150 ns 2,011.01 - NA
SumList PR Syste(...)nt32] [47] 0.2793 ns 0.0036 ns 1.02 - NA
SumList PR Syste(...)nt32] [47] 5.4416 ns 0.0127 ns 19.88 - NA
SumList PR Syste(...)nt32] [47] 815.1559 ns 15.9533 ns 2,978.53 - NA
SumEnumerable Main Syste(...)nt32] [47] 0.7331 ns 0.0008 ns 1.00 - NA
SumEnumerable Main Syste(...)nt32] [47] 5.5749 ns 0.0054 ns 7.60 - NA
SumEnumerable Main Syste(...)nt32] [47] 1,342.4077 ns 1.6884 ns 1,831.07 40 B NA
SumEnumerable PR Syste(...)nt32] [47] 1.0050 ns 0.0005 ns 1.37 - NA
SumEnumerable PR Syste(...)nt32] [47] 7.9063 ns 0.0079 ns 10.78 - NA
SumEnumerable PR Syste(...)nt32] [47] 824.4177 ns 0.3027 ns 1,124.52 - NA

BDN_Artifacts.zip

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

@EgorBo
Copy link

EgorBo commented May 30, 2025

I presume BenchmarkDotNet doesn't know how to group by List<> (or convert it into a string)

@EgorBot
Copy link
Owner Author

EgorBot commented May 30, 2025

Benchmark results on linux_azure_cascadelake

BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 8 logical and 4 physical cores
  Job-KZRWMC : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-ZVBCOB : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain list Mean Error Ratio Allocated Alloc Ratio
SumList Main Syste(...)nt32] [47] 0.5750 ns 0.0004 ns 1.00 - NA
SumList Main Syste(...)nt32] [47] 6.0422 ns 0.0024 ns 10.51 - NA
SumList Main Syste(...)nt32] [47] 581.8955 ns 0.0866 ns 1,012.04 - NA
SumList PR Syste(...)nt32] [47] 0.8994 ns 0.0024 ns 1.56 - NA
SumList PR Syste(...)nt32] [47] 5.0944 ns 0.0010 ns 8.86 - NA
SumList PR Syste(...)nt32] [47] 585.5829 ns 0.0849 ns 1,018.45 - NA
SumEnumerable Main Syste(...)nt32] [47] 0.8494 ns 0.0039 ns 1.00 - NA
SumEnumerable Main Syste(...)nt32] [47] 6.0548 ns 0.0022 ns 7.13 - NA
SumEnumerable Main Syste(...)nt32] [47] 1,928.9325 ns 0.2399 ns 2,270.86 40 B NA
SumEnumerable PR Syste(...)nt32] [47] 0.8826 ns 0.0080 ns 1.04 - NA
SumEnumerable PR Syste(...)nt32] [47] 6.9237 ns 0.0073 ns 8.15 - NA
SumEnumerable PR Syste(...)nt32] [47] 643.4909 ns 0.2241 ns 757.56 - NA

BDN_Artifacts.zip

cc @stephentoub (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

2 participants