Created
April 20, 2021 12:12
-
-
Save amacal/75f8da225ba8cca922f92b40e6217bb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Main(string[] args) | |
{ | |
long counter = 0; | |
Random randomizer = new Random(); | |
DataDictionary dictionary = new DataDictionary(); | |
for (int i = 0; i < 500000000; i++) | |
{ | |
int reads = randomizer.Next(0, 10000000); | |
byte[] key = new byte[randomizer.Next(4, 4)]; | |
byte[] value = new byte[randomizer.Next(32, 76)]; | |
randomizer.NextBytes(key); | |
randomizer.NextBytes(value); | |
dictionary.Set(key, value); | |
if (i % 10000000 + 1 == 10000000) | |
{ | |
for (int j = 0; j < 10000000; j++) | |
{ | |
key = new byte[randomizer.Next(4, 4)]; | |
randomizer.NextBytes(key); | |
if (dictionary.Get(key) != null) | |
counter++; | |
} | |
Console.Write(dictionary.Describe()); | |
Console.WriteLine($" {counter}"); | |
} | |
} | |
Console.Write(dictionary.Describe()); | |
Console.WriteLine($" {counter}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment