File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1414
1515#include < vector>
1616
17-
18- static const int MIN_CORES = 2 ;
1917static const size_t BATCHES = 101 ;
2018static const size_t BATCH_SIZE = 30 ;
2119static const int PREVECTOR_SIZE = 28 ;
@@ -26,6 +24,9 @@ static const unsigned int QUEUE_BATCH_SIZE = 128;
2624// and there is a little bit of work done between calls to Add.
2725static void CCheckQueueSpeedPrevectorJob (benchmark::Bench& bench)
2826{
27+ // We shouldn't ever be running with the checkqueue on a single core machine.
28+ if (GetNumCores () <= 1 ) return ;
29+
2930 const ECCVerifyHandle verify_handle;
3031 ECC_Start ();
3132
@@ -44,7 +45,9 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
4445 };
4546 CCheckQueue<PrevectorJob> queue {QUEUE_BATCH_SIZE};
4647 boost::thread_group tg;
47- for (auto x = 0 ; x < std::max (MIN_CORES, GetNumCores ()); ++x) {
48+ // The main thread should be counted to prevent thread oversubscription, and
49+ // to decrease the variance of benchmark results.
50+ for (auto x = 0 ; x < GetNumCores () - 1 ; ++x) {
4851 tg.create_thread ([&]{queue.Thread ();});
4952 }
5053
You can’t perform that action at this time.
0 commit comments