Faster.Map: Arithmetic operation resulted in an overflow #2
unfortunately this is not the problem with int.MaxValue
var map = new RobinhoodMap<uint,uint>(64);
try
{
for (uint i = 0; i < uint.MaxValue; i++)
{
if (((i * 0x9E3779B9U) >> 8) == 63)
{
map.Emplace(i, 0);
}
}
}
catch (Exception ex)
{
Console.WriteLine("map.Count={0}, {1}", map.Count, ex.Message);
}
map.Count=93, Arithmetic operation resulted in an overflow.
there are only 256 numbers that satisfy the condition (((i * 0x9E3779B9U) >> 8) == 63)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 36 (17 by maintainers)
Random(3) or Random.Shared in tests generate unique values only (: _dict.Add((ulong)Random.Shared.NextInt64(), 0); gen exception if duplicate value
AddBenchmark.cs.txt this is optimal benchmark with raw perfomance, i think
I’ll run it on different processors right now. The results are getting more and more interesting