Skip to content

Conversation

@2A5F
Copy link
Contributor

@2A5F 2A5F commented Dec 10, 2025

#116109 (comment)

This may not be necessary, but it's still worth improving.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Dec 10, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 10, 2025
@2A5F
Copy link
Contributor Author

2A5F commented Dec 10, 2025

@EgorBot -intel -arm

using BenchmarkDotNet.Attributes;

public class Bench
{
    int[] a = new int[10000];
    int[] b = new int[10000];
    MyComparer<string> c = new MyComparer<string>();

    [IterationSetup]
    public void IterationSetup() { for (int i = 0; i < a.Length; i++) a[i] = i; }

    [Benchmark]
    public void Sort() => MemoryExtensions.Sort(a, b, c);

    struct MyComparer<T> : IComparer<int>
    {
        T state;
        long a,b,c,d,e,f;

        public int Compare(int x, int y) => x-y;
    }   
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates that the PR has been added by a community member needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant