public void ObjectModificationsLookFine(int count, bool verbose) { var identifiedObjects = _factory.Read().Take(count); foreach (var identifiedObject in identifiedObjects) { CheckIt(identifiedObject, verbose); } }
public void MeasureDiff(int count) { var originalObjects = _factory.Read().Take(count).ToList(); var mutatedObjects = Mutate(originalObjects).ToList(); var diffStopwatch = Stopwatch.StartNew(); var diff = _differ.GetDiff(originalObjects, mutatedObjects).ToList(); var totalDiffSeconds = diffStopwatch.Elapsed.TotalSeconds; Console.WriteLine($"Generating diff for {count} objects took {totalDiffSeconds} - that's {count / totalDiffSeconds:0.0} obj/s"); var applyStopwatch = Stopwatch.StartNew(); _differ.ApplyDiff(originalObjects, diff).ToList(); var totalApplySeconds = applyStopwatch.Elapsed.TotalSeconds; Console.WriteLine($"Applying diff for {count} objects took {totalApplySeconds} - that's {count / totalApplySeconds:0.0} obj/s"); }