Skip to content

Benchmarks for #116150 (stephentoub) #367

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 · 3 comments
Open

Benchmarks for #116150 (stephentoub) #367

EgorBot opened this issue May 30, 2025 · 3 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;
using System.Runtime.CompilerServices;

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

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

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

    [MethodImpl(MethodImplOptions.NoInlining)]
    private static int Process(string item) => item.Length;

    public static IEnumerable<List<string>> GetLists() =>
        from count in new int[] { 1, 10, 1_000 }
        select Enumerable.Range(0, count).Select(i => i.ToString()).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-FDIWLW : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
  Job-ANPZGD : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Method Toolchain list Mean Error Ratio Code Size Allocated Alloc Ratio
SumList Main Syste(...)ring] [48] 1.580 ns 0.0045 ns 1.00 200 B - NA
SumList Main Syste(...)ring] [48] 13.940 ns 0.0101 ns 8.82 192 B - NA
SumList Main Syste(...)ring] [48] 1,500.712 ns 0.6422 ns 949.57 192 B - NA
SumList PR Syste(...)ring] [48] 1.343 ns 0.0013 ns 0.85 176 B - NA
SumList PR Syste(...)ring] [48] 14.394 ns 0.0006 ns 9.11 176 B - NA
SumList PR Syste(...)ring] [48] 1,541.275 ns 0.2865 ns 975.23 176 B - NA
SumEnumerable Main Syste(...)ring] [48] 1.677 ns 0.0028 ns 1.00 504 B - NA
SumEnumerable Main Syste(...)ring] [48] 14.163 ns 0.0113 ns 8.44 488 B - NA
SumEnumerable Main Syste(...)ring] [48] 4,108.685 ns 0.8681 ns 2,449.40 896 B 40 B NA
SumEnumerable PR Syste(...)ring] [48] 1.632 ns 0.0077 ns 0.97 472 B - NA
SumEnumerable PR Syste(...)ring] [48] 14.777 ns 0.0401 ns 8.81 472 B - NA
SumEnumerable PR Syste(...)ring] [48] 1,515.981 ns 0.1142 ns 903.76 472 B - 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-BXXNEZ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-ACWTBM : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain list Mean Error Ratio Code Size Allocated Alloc Ratio
SumList Main Syste(...)ring] [48] 1.842 ns 0.0016 ns 1.00 124 B - NA
SumList Main Syste(...)ring] [48] 13.903 ns 0.0028 ns 7.55 109 B - NA
SumList Main Syste(...)ring] [48] 1,724.675 ns 34.2550 ns 936.45 109 B - NA
SumList PR Syste(...)ring] [48] 1.732 ns 0.0044 ns 0.94 101 B - NA
SumList PR Syste(...)ring] [48] 16.351 ns 0.0272 ns 8.88 101 B - NA
SumList PR Syste(...)ring] [48] 1,642.222 ns 0.1759 ns 891.68 101 B - NA
SumEnumerable Main Syste(...)ring] [48] 2.085 ns 0.0049 ns 1.00 358 B - NA
SumEnumerable Main Syste(...)ring] [48] 14.452 ns 0.0036 ns 6.93 351 B - NA
SumEnumerable Main Syste(...)ring] [48] 3,114.572 ns 61.5042 ns 1,493.72 692 B 40 B NA
SumEnumerable PR Syste(...)ring] [48] 2.181 ns 0.0013 ns 1.05 339 B - NA
SumEnumerable PR Syste(...)ring] [48] 16.631 ns 0.0059 ns 7.98 339 B - NA
SumEnumerable PR Syste(...)ring] [48] 1,643.237 ns 0.3006 ns 788.08 339 B - 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_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-VNGXKY : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-OVQVEA : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain list Mean Error Ratio Code Size Allocated Alloc Ratio
SumList Main Syste(...)ring] [48] 1.853 ns 0.0123 ns 1.00 124 B - NA
SumList Main Syste(...)ring] [48] 15.258 ns 0.0092 ns 8.23 109 B - NA
SumList Main Syste(...)ring] [48] 1,445.357 ns 0.2705 ns 779.94 109 B - NA
SumList PR Syste(...)ring] [48] 1.713 ns 0.0008 ns 0.92 101 B - NA
SumList PR Syste(...)ring] [48] 15.255 ns 0.0072 ns 8.23 101 B - NA
SumList PR Syste(...)ring] [48] 1,446.942 ns 0.3480 ns 780.80 101 B - NA
SumEnumerable Main Syste(...)ring] [48] 2.020 ns 0.0045 ns 1.00 358 B - NA
SumEnumerable Main Syste(...)ring] [48] 15.537 ns 0.0040 ns 7.69 351 B - NA
SumEnumerable Main Syste(...)ring] [48] 2,339.841 ns 0.7131 ns 1,158.47 692 B 40 B NA
SumEnumerable PR Syste(...)ring] [48] 2.017 ns 0.0005 ns 1.00 339 B - NA
SumEnumerable PR Syste(...)ring] [48] 15.560 ns 0.0325 ns 7.70 339 B - NA
SumEnumerable PR Syste(...)ring] [48] 1,446.462 ns 0.1095 ns 716.15 339 B - 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

1 participant