private static void CreateAndProcessFile(RandomAccessor data, SerializationEngine serializer, IReadOnlyList <TestClass> list, Action <Action <int> > loop) { var lFile = new LowLevelAppendOnlyFile(data); var file = new GenericAppendOnlyFile <TestClass>(lFile, serializer); // append COUNT records ShowTimeIncludingOpsPerSec("append", () => loop(i => file.Append(list[i]))); // read all the records in a single batch ShowTimeIncludingOpsPerSec("read all in a single batch", () => { var records = file.ReadFrom(0).ToList(); }); // read all the records, individually ShowTimeIncludingOpsPerSec("read all, individually", () => loop(i => file.Read(i))); }
public LowLevelAppendOnlyFile(RandomAccessor data, IEnumerable <long> index = null) { this.data = data; this.index = new List <long>(index ?? RebuildIndex()); }
public LowLevelAppendOnlyFile(RandomAccessor data, IEnumerable<long> index = null) { this.data = data; this.index = new List<long>(index ?? RebuildIndex()); }