-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Processing dotnet/runtime#116057 (comment) command:
Command
-arm -amd -windows_intel
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkSwitcher.FromAssembly(typeof(Bench).Assembly).Run(args);
public class Bench
{
private static Dictionary<string, int> Dictionary
// We don't need to fill the dictionary as we're only benchmarking the hashcode operation.
= new() { { "1", 2 } };
[Benchmark]
[ArgumentsSource(nameof(GetKeys))]
public bool Contains(string key) => Dictionary.ContainsKey(key);
public static IEnumerable<string> GetKeys()
{
foreach (int len in (int[])[1, 3, 5, 8, 10, 16, 20, 32, 40, 50, 100, 1000, 10000])
yield return new string('a', len);
}
}(EgorBot will reply in this issue)
Metadata
Metadata
Assignees
Labels
No labels