コード例 #1
0
        /// <summary>
        /// Run multithreaded operations.
        /// </summary>
        /// <param name="worker">The worker to use.</param>
        private static void StressThread(PerfTestWorker worker)
        {
            int numRecords   = 5000 * worker.RandomGenerator.Next(0, 10);
            int numRetrieves = 50 + worker.RandomGenerator.Next(0, 100);

            worker.InsertRecordsWithAddFunction(numRecords);
            worker.CloseReopenDictionary();

            worker.RepeatedlyRetrieveOneRecord(numRetrieves);
            worker.CloseReopenDictionary();
            worker.RepeatedlyRetrieveOneRecordWithTryGetValue(numRetrieves);
            worker.CloseReopenDictionary();
            worker.RepeatedlyRetrieveOneRecordWithBracketOperator(numRetrieves);
            worker.CloseReopenDictionary();
            worker.RetrieveAllRecords();
            worker.CloseReopenDictionary();

            worker.CloseReopenDictionary();
            worker.InsertRecordsWithBracketOperator(numRecords);
            worker.CloseReopenDictionary();
            worker.RepeatedlyRetrieveOneRecord(numRetrieves);
            worker.CloseReopenDictionary();
            worker.RepeatedlyRetrieveOneRecordWithTryGetValue(numRetrieves);
            worker.CloseReopenDictionary();
            worker.RepeatedlyRetrieveOneRecordWithBracketOperator(numRetrieves);
            worker.CloseReopenDictionary();
            worker.RetrieveAllRecords();
        }
コード例 #2
0
        /// <summary>
        /// Run multithreaded operations.
        /// </summary>
        /// <param name="worker">The worker to use.</param>
        private static void StressThread(PerfTestWorker worker)
        {
            const int NumRecords   = 50000;
            const int NumRetrieves = 100;

            worker.InsertRecordsWithAddFunction(NumRecords);
            worker.RepeatedlyRetrieveOneRecord(NumRetrieves);
            worker.RepeatedlyRetrieveOneRecordWithTryGetValue(NumRetrieves);
            worker.RepeatedlyRetrieveOneRecordWithBracketOperator(NumRetrieves);
            worker.RetrieveAllRecords();

            worker.InsertRecordsWithBracketOperator(NumRecords);
            worker.RepeatedlyRetrieveOneRecord(NumRetrieves);
            worker.RepeatedlyRetrieveOneRecordWithTryGetValue(NumRetrieves);
            worker.RepeatedlyRetrieveOneRecordWithBracketOperator(NumRetrieves);
            worker.RetrieveAllRecords();
        }
コード例 #3
0
        /// <summary>
        /// Run multithreaded operations.
        /// </summary>
        /// <param name="worker">The worker to use.</param>
        private static void StressThreadTrx(PerfTestWorker worker)
        {
            const int NumRecords   = 50000;
            const int NumRetrieves = 100;

            worker.InsertRecordsWithSetColumn(NumRecords);
            worker.RepeatedlyRetrieveOneRecord(NumRetrieves);
            worker.RepeatedlyRetrieveOneRecordWithJetRetrieveColumns(NumRetrieves);
            worker.RepeatedlyRetrieveOneRecordWithRetrieveColumns(NumRetrieves);
            worker.RepeatedlyRetrieveOneRecordWithEnumColumns(NumRetrieves);
            worker.RetrieveAllRecords();

            worker.InsertRecordsWithSetColumns(NumRecords);
            worker.RepeatedlyRetrieveOneRecord(NumRetrieves);
            worker.RepeatedlyRetrieveOneRecordWithJetRetrieveColumns(NumRetrieves);
            worker.RepeatedlyRetrieveOneRecordWithRetrieveColumns(NumRetrieves);
            worker.RepeatedlyRetrieveOneRecordWithEnumColumns(NumRetrieves);
            worker.RetrieveAllRecords();
        }