-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Processing dotnet/runtime#114792 (comment) command:
Command
-intel -amd
using System;
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;
public class Bench
{
const int Count = 40960;
private static readonly Dictionary<int, int> ints = new (Count * 2);
private static readonly List<int> keys = new ();
static Bench () {
var rng = new Random(1);
for (int i = 0; i < Count; i++) {
var key = rng.Next();
keys.Add(key);
ints[keys[i]] = i;
}
}
[Benchmark]
public bool FindPresent() {
for (int i = 0; i < Count; i++)
if (!ints.TryGetValue(keys[i], out _))
return false;
return true;
}
}(EgorBot will reply in this issue)
Metadata
Metadata
Assignees
Labels
No labels