7 ms·
> the C++ lookup took 1 nanosecond[0] and the C# version took 1ms (1000x slower) The ratio between 1 ns and 1 ms is a million.
by nayuki 4y ago
> the C++ lookup took 1 nanosecond[0] and the C# version took 1ms (1000x slower)
The ratio between 1 ns and 1 ms is a million.
- flohofwoe 4y agoThe link talks about nano- vs micro-seconds, so probably just a typo.
- _gabe_ 4y agoI just re-ran the benchmarks and I was mis-remembering those statistics quite a bit. It looks like C# takes 124.5 nanoseconds on average for a hash set lookup. This was benchmarked using BenchmarkDotNet :)