public void CacheCreate1000000Test() { Stopwatch w = new Stopwatch(); w.Start(); var store = new ProcessDefinitionStoreD(); w.Stop(); Debug.WriteLine("Initialize instance : " + w.ElapsedMilliseconds + "ms"); w.Restart(); for (int i = 0; i < 1000000; i++) { var t = new ProcessDefinition(); t.ProcessDefinitionId = Guid.NewGuid().ToString(); store.Create(t); } w.Stop(); Debug.WriteLine("Add1000000Test : " + w.ElapsedMilliseconds + "ms"); w.Restart(); for (int i = 0; i < 1000000; i++) { var t = new ProcessDefinition(); t.ProcessDefinitionId = Guid.NewGuid().ToString(); store.Create(t); } w.Stop(); Debug.WriteLine("Add1000000Test : " + w.ElapsedMilliseconds + "ms"); store.Dispose(); }
public ProcessDefinitionStoreTests() { store = new ProcessDefinitionStoreD(); pd = new ProcessDefinition(); pd.ProcessDefinitionId = Guid.NewGuid().ToString(); store.Create(pd); }
public void CacheCreate100000TestAsync() { Stopwatch w = new Stopwatch(); w.Start(); var store = new ProcessDefinitionStoreD(); Task[] task = new Task[100000]; for (int i = 0; i < 100000; i++) { task[i] = Task.Run(() => { var t = new ProcessDefinition(); t.ProcessDefinitionId = Guid.NewGuid().ToString(); store.Create(t); }); } Task.WaitAll(task); w.Stop(); Debug.WriteLine("CacheCreate100000TestAsync : " + w.ElapsedMilliseconds + "ms"); store.Dispose(); }
public void CreateTest() { store.Create(pd); }