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 AndyAyersMS in #109209 #140

Open
EgorBot opened this issue Oct 27, 2024 · 4 comments
Open

EgorBot for AndyAyersMS in #109209 #140

EgorBot opened this issue Oct 27, 2024 · 4 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented Oct 27, 2024

Processing dotnet/runtime#109209 (comment) command:

Command

-intel -arm64 -profiler --envvars DOTNET_JitDisasm:Foreach Count

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

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

public class Bench
{
    string[] s_ro_str_array = new string[512];

    [Benchmark]
    public int Foreach()
    {
        IEnumerable<string> e = s_ro_str_array;
        int sum = 0;
        foreach (string s in e) sum += s == null ? 0 : s.Length;
        return sum;
    }

    [Benchmark]
    public int Count() => CountInner(s_ro_str_array);

    [MethodImpl(MethodImplOptions.NoInlining)]
    int CountInner(ICollection<string> c) => c.Count;
}

(EgorBot will reply in this issue)

@EgorBot
Copy link
Owner Author

EgorBot commented Oct 27, 2024

Benchmark results on Arm64

BDN_Artifacts.zip

Profile for Bench_Foreach:

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

Profile for Bench_Count:

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 Oct 27, 2024

cc @AndyAyersMS (logs)

@EgorBot
Copy link
Owner Author

EgorBot commented Oct 27, 2024

Benchmark results on Intel

BDN_Artifacts.zip

Profile for Bench_Foreach:

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

Profile for Bench_Count:

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 Oct 27, 2024

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

1 participant