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 14
14
15
15
#include < vector>
16
16
17
-
18
- static const int MIN_CORES = 2 ;
19
17
static const size_t BATCHES = 101 ;
20
18
static const size_t BATCH_SIZE = 30 ;
21
19
static const int PREVECTOR_SIZE = 28 ;
@@ -26,6 +24,9 @@ static const unsigned int QUEUE_BATCH_SIZE = 128;
26
24
// and there is a little bit of work done between calls to Add.
27
25
static void CCheckQueueSpeedPrevectorJob (benchmark::Bench& bench)
28
26
{
27
+ // We shouldn't ever be running with the checkqueue on a single core machine.
28
+ if (GetNumCores () <= 1 ) return ;
29
+
29
30
const ECCVerifyHandle verify_handle;
30
31
ECC_Start ();
31
32
@@ -44,7 +45,9 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
44
45
};
45
46
CCheckQueue<PrevectorJob> queue {QUEUE_BATCH_SIZE};
46
47
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) {
48
51
tg.create_thread ([&]{queue.Thread ();});
49
52
}
50
53
You can’t perform that action at this time.
0 commit comments