20 #include <condition_variable> 23 #include <boost/thread/barrier.hpp> 29 DEFINE_int32(digest_merge_time_ns, 5500,
"Time to merge into the digest");
31 using namespace folly;
40 auto finish =
start + std::chrono::nanoseconds{FLAGS_digest_merge_time_ns};
47 unsigned int append(
unsigned int iters,
size_t bufSize,
size_t nThreads) {
49 auto buffer = std::make_shared<DigestBuilder<FreeDigest>>(bufSize, 100);
51 auto barrier = std::make_shared<boost::barrier>(nThreads + 1);
53 std::vector<std::thread>
threads;
54 threads.reserve(nThreads);
56 for (
size_t i = 0;
i < nThreads; ++
i) {
57 threads.emplace_back([&]() {
59 for (
size_t iter = 0; iter < iters; ++iter) {
70 for (
auto& thread : threads) {
113 gflags::ParseCommandLineFlags(&argc, &
argv,
true);
std::vector< uint8_t > buffer(kBufferSize+16)
#define BENCHMARK_SUSPEND
std::chrono::steady_clock::time_point now()
—— Concurrent Priority Queue Implementation ——
unsigned int append(unsigned int iters, size_t bufSize, size_t nThreads)
std::vector< std::thread::id > threads
#define BENCHMARK_RELATIVE_NAMED_PARAM_MULTI(name, param_name,...)
FreeDigest merge(Range< const double * >) const
DEFINE_int32(digest_merge_time_ns, 5500,"Time to merge into the digest")
int main(int argc, char *argv[])
#define BENCHMARK_NAMED_PARAM_MULTI(name, param_name,...)