/// <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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }