private static void SingelThread_Esent() { Console.WriteLine("SingelThread_Esent"); //var dict = new Dictionary<string, string>("SingelThread_HashOnDisk", MaxCount); //var dict = new Dictionary<long, long>("SingelThread_HashOnDisk", MaxCount); var dict = new EsentCollections.PersistentDictionary <long, long>("./App_data"); Stopwatch sw = Stopwatch.StartNew(); for (long i = 0; i < MaxCount; i++) { //string key = Guid.NewGuid().ToString(); //dict.Add(key, key); //dict.Add(i, i); //dict[i] = i; //if (string.IsNullOrEmpty(dict[key])) throw new Exception(); if (dict[i] != i) { throw new Exception(); } } sw.Stop(); Console.WriteLine(sw.Elapsed); dict.Dispose(); }
private static void SingelThread_Esent() { Console.WriteLine("SingelThread_Esent"); //var dict = new Dictionary<string, string>("SingelThread_HashOnDisk", MaxCount); //var dict = new Dictionary<long, long>("SingelThread_HashOnDisk", MaxCount); var dict = new EsentCollections.PersistentDictionary<long, long>("./App_data"); Stopwatch sw = Stopwatch.StartNew(); for (long i = 0; i < MaxCount; i++) { //string key = Guid.NewGuid().ToString(); //dict.Add(key, key); //dict.Add(i, i); //dict[i] = i; //if (string.IsNullOrEmpty(dict[key])) throw new Exception(); if (dict[i] != i) throw new Exception(); } sw.Stop(); Console.WriteLine(sw.Elapsed); dict.Dispose(); }