12 #include <boost/thread/thread.hpp>
15 static const int MIN_CORES = 2;
16 static const size_t BATCHES = 101;
17 static const size_t BATCH_SIZE = 30;
18 static const int PREVECTOR_SIZE = 28;
19 static const unsigned int QUEUE_BATCH_SIZE = 128;
37 void swap(PrevectorJob& x){p.
swap(x.p);};
40 boost::thread_group tg;
41 for (
auto x = 0; x < std::max(MIN_CORES,
GetNumCores()); ++x) {
42 tg.create_thread([&]{queue.Thread();});
48 std::vector<std::vector<PrevectorJob>> vBatches(BATCHES);
49 for (
auto& vChecks : vBatches) {
50 vChecks.reserve(BATCH_SIZE);
51 for (
size_t x = 0; x < BATCH_SIZE; ++x)
52 vChecks.emplace_back(insecure_rand);
BENCHMARK(CCheckQueueSpeedPrevectorJob, 1400)
RAII-style controller object for a CCheckQueue that guarantees the passed queue is finished before co...
Queue for verifications that have to be performed.
uint32_t rand32() noexcept
Generate a random 32-bit integer.
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
void swap(prevector< N, T, Size, Diff > &other)
void resize(size_type new_size)
int GetNumCores()
Return the number of cores available on the current system.