diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-07-07 10:40:13 +0100 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-10-03 10:52:15 +0100 |
commit | 9cf89f7a5b81197e38f58b24be0793b28fe41477 (patch) | |
tree | 35b1e832535ac77684d842f524310e14a837fe94 /src/bench/checkqueue.cpp | |
parent | d03eaacbcfb276fb638db1b423113ff43bd7ec41 (diff) |
refactor: Make `CCheckQueue` constructor start worker threads
Diffstat (limited to 'src/bench/checkqueue.cpp')
-rw-r--r-- | src/bench/checkqueue.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bench/checkqueue.cpp b/src/bench/checkqueue.cpp index c7e1ad4f83..114dd9d39c 100644 --- a/src/bench/checkqueue.cpp +++ b/src/bench/checkqueue.cpp @@ -37,10 +37,11 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench) return true; } }; - CCheckQueue<PrevectorJob> queue {QUEUE_BATCH_SIZE}; + // The main thread should be counted to prevent thread oversubscription, and // to decrease the variance of benchmark results. - queue.StartWorkerThreads(GetNumCores() - 1); + int worker_threads_num{GetNumCores() - 1}; + CCheckQueue<PrevectorJob> queue{QUEUE_BATCH_SIZE, worker_threads_num}; // create all the data once, then submit copies in the benchmark. FastRandomContext insecure_rand(true); |