/// <summary> /// Insert some string records and then retrieve them. /// </summary> private void InsertReadSeekStrings() { const int NumRecords = 100 * 1000; long[] keys = this.GetRandomKeys(NumRecords); IEnumerable <string> stringKeys = keys.Select((key) => { return(key.ToString()); }); using (var worker = new PerfTestWorker( this.longDictionary, this.longDatabase, this.stringDictionary, this.stringDatabase)) { TimeAction("Insert string record with Add()s", () => worker.InsertStringRecordsWithAddFunction(NumRecords / 2)); TimeAction("Insert string records with []", () => worker.InsertStringRecordsWithBracketOperator(NumRecords / 2)); TimeAction("Read one string record", () => worker.RepeatedlyRetrieveOneStringRecord(NumRecords)); TimeAction("Read one string record with JetRetrieveColumns", () => worker.RepeatedlyRetrieveOneStringRecordWithTryGetValue(NumRecords)); TimeAction("Read one string record with RetrieveColumns", () => worker.RepeatedlyRetrieveOneStringRecordWithBracketOperator(NumRecords)); TimeAction("Read all string records", worker.RetrieveAllStringRecords); TimeAction("Seek to all string records randomly", () => worker.SeekToAllStringRecords(stringKeys)); } }