proxygen
|
#include <folly/experimental/FlatCombiningPriorityQueue.h>
#include <folly/Benchmark.h>
#include <folly/portability/GTest.h>
#include <glog/logging.h>
#include <condition_variable>
#include <mutex>
#include <queue>
Go to the source code of this file.
Classes | |
class | BaselinePQ< T, PriorityQueue, Mutex > |
Typedefs | |
using | FCPQ = folly::FlatCombiningPriorityQueue< int > |
using | Baseline = BaselinePQ< int > |
Enumerations | |
enum | Exp { NoFC, FCNonBlock, FCBlock, FCTimed } |
Functions | |
DEFINE_bool (bench, false,"run benchmark") | |
DEFINE_int32 (reps, 10,"number of reps") | |
DEFINE_int32 (ops, 100000,"number of operations per rep") | |
DEFINE_int32 (size, 64,"initial size of the priority queue") | |
DEFINE_int32 (work, 1000,"amount of unrelated work per operation") | |
void | doWork (int work) |
template<typename PriorityQueue , typename Func > | |
static uint64_t | run_once (PriorityQueue &pq, const Func &fn) |
TEST (FCPriQueue, basic) | |
TEST (FCPriQueue, bounded) | |
TEST (FCPriQueue, timeout) | |
TEST (FCPriQueue, push_pop) | |
static uint64_t | test (std::string name, Exp exp, uint64_t base) |
TEST (FCPriQueue, bench) | |
Variables | |
static std::vector< int > | nthr = {1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64} |
static uint32_t | nthreads |
using Baseline = BaselinePQ<int> |
Definition at line 108 of file FlatCombiningPriorityQueueTest.cpp.
using FCPQ = folly::FlatCombiningPriorityQueue<int> |
Definition at line 107 of file FlatCombiningPriorityQueueTest.cpp.
enum Exp |
Enumerator | |
---|---|
NoFC | |
FCNonBlock | |
FCBlock | |
FCTimed |
Definition at line 272 of file FlatCombiningPriorityQueueTest.cpp.
DEFINE_int32 | ( | reps | , |
10 | , | ||
"number of reps" | |||
) |
DEFINE_int32 | ( | ops | , |
100000 | , | ||
"number of operations per rep" | |||
) |
DEFINE_int32 | ( | size | , |
64 | , | ||
"initial size of the priority queue" | |||
) |
DEFINE_int32 | ( | work | , |
1000 | , | ||
"amount of unrelated work per operation" | |||
) |
void doWork | ( | int | work | ) |
Definition at line 32 of file FlatCombiningPriorityQueueTest.cpp.
References a, folly::doNotOptimizeAway(), i, mutex, Mutex, T, and uint64_t.
Referenced by TEST(), and test().
|
static |
Definition at line 118 of file FlatCombiningPriorityQueueTest.cpp.
References count, i, now(), nthreads, ops, BaselinePQ< T, PriorityQueue, Mutex >::size(), start, folly::pushmi::detail::t, threads, uint32_t, and uint64_t.
Referenced by TEST(), and test().
TEST | ( | FCPriQueue | , |
basic | |||
) |
Definition at line 159 of file FlatCombiningPriorityQueueTest.cpp.
References EXPECT_EQ, EXPECT_FALSE, and v.
TEST | ( | FCPriQueue | , |
bounded | |||
) |
TEST | ( | FCPriQueue | , |
timeout | |||
) |
Definition at line 216 of file FlatCombiningPriorityQueueTest.cpp.
References EXPECT_EQ, EXPECT_FALSE, now(), and v.
TEST | ( | FCPriQueue | , |
push_pop | |||
) |
Definition at line 247 of file FlatCombiningPriorityQueueTest.cpp.
References doWork(), EXPECT_NE, i, folly::none, now(), nthreads, ops, run_once(), uint32_t, v, and folly::when().
|
static |
Definition at line 279 of file FlatCombiningPriorityQueueTest.cpp.
References doWork(), EXPECT_NE, FCBlock, FCNonBlock, FCTimed, i, max, min, name, NoFC, folly::none, now(), nthreads, ops, run_once(), sum(), BaselinePQ< T, PriorityQueue, Mutex >::try_pop(), BaselinePQ< T, PriorityQueue, Mutex >::try_push(), uint32_t, uint64_t, v, and folly::when().
Referenced by TEST().
TEST | ( | FCPriQueue | , |
bench | |||
) |
Definition at line 369 of file FlatCombiningPriorityQueueTest.cpp.
References FCBlock, FCNonBlock, FCTimed, i, NoFC, nthreads, test(), and uint64_t.
|
static |
Definition at line 113 of file FlatCombiningPriorityQueueTest.cpp.
|
static |
Definition at line 115 of file FlatCombiningPriorityQueueTest.cpp.
Referenced by run_once(), TEST(), and test().