public void EnumerateAll(DlfitTestConfiguration config) { // About count = 1: There is no need to execute the tests multiple times // the test itself repeats the Search operation 'size' times. // (the displayed time is for _one_ operation) config.Benchmark(config.TestName, config.Size, 1); }
public void Add(DlfitTestConfiguration config) { // About count = 1: There is no need to execute the tests multiple times // the test itself repeats the Add operation 'size' times. // (the displayed time is notmalized for _one_ operation) config.Benchmark(config.TestName, config.Size, 3); }
private void PrepareSearch(int size, Type type, DlfitTestConfiguration config) { // Do not generate in random order to speed up test preparation config.RandomDateTimeIntervals = new IntervalBase <DateTime> [size]; config.Target = CreateTarget <DateTime>(type); for (var i = 0; i < size; i++) { var low = new DateTime(_offset + i * 10); config.RandomDateTimeIntervals[i] = new IntervalBase <DateTime>(low, low.AddTicks(5)); config.Target.Add(config.RandomDateTimeIntervals[i]); } }
private void PrepareAdd(int size, Type type, DlfitTestConfiguration config) { config.RandomDateTimeIntervals = new IntervalBase <DateTime> [size]; var permutation = Randomize(GetZeroToN(size)).ToArray(); for (var i = 0; i < size; i++) { var low = new DateTime(_offset + permutation[i] * 10); config.RandomDateTimeIntervals[i] = new IntervalBase <DateTime>(low, low.AddTicks(5)); } config.Target = CreateTarget <DateTime>(type); }
private void PrepareRemove(int size, Type type, DlfitTestConfiguration config) { // Do not generate in random order to speed up test preparation PrepareSearch(size, type, config); // Regenerate a random order for removal: config.RandomDateTimeIntervals = new IntervalBase <DateTime> [size]; var permutation = Randomize(GetZeroToN(size)).ToArray(); for (var i = 0; i < size; i++) { var low = new DateTime(_offset + permutation[i] * 10); config.RandomDateTimeIntervals[i] = new IntervalBase <DateTime>(low, low.AddTicks(5)); } }
public void FindFirst(DlfitTestConfiguration config) { config.Benchmark(config.TestName, config.Size, 3); }