Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <sstream>
#include <boost/thread.hpp>
#include <boost/thread/mutex.hpp>
#include "util/benchmark.h"
#include "util/cpu-info.h"
#include "util/spinlock.h"
#include "common/names.h"
Go to the source code of this file.
Classes | |
struct | TestData< Decimal > |
Typedefs | |
typedef function< void(int64_t, int64_t *)> | Fn |
Functions | |
void | UnlockedConsumeThread (int64_t n, int64_t *value) |
void | UnlockedProduceThread (int64_t n, int64_t *value) |
void | AtomicConsumeThread (int64_t n, int64_t *value) |
void | AtomicProduceThread (int64_t n, int64_t *value) |
void | SpinLockConsumeThread (int64_t n, int64_t *value) |
void | SpinLockProduceThread (int64_t n, int64_t *value) |
void | BoostConsumeThread (int64_t n, int64_t *value) |
void | BoostProduceThread (int64_t n, int64_t *value) |
void | LaunchThreads (void *d, Fn consume_fn, Fn produce_fn, int64_t scale) |
void | TestUnlocked (int batch_size, void *d) |
void | TestAtomic (int batch_size, void *d) |
void | TestSpinLock (int batch_size, void *d) |
void | TestBoost (int batch_size, void *d) |
int | main (int argc, char **argv) |
Variables | |
mutex | lock_ |
SpinLock | spinlock_ |
typedef function<void (int64_t, int64_t*)> Fn |
Definition at line 75 of file lock-benchmark.cc.
void AtomicConsumeThread | ( | int64_t | n, |
int64_t * | value | ||
) |
Definition at line 92 of file lock-benchmark.cc.
Referenced by TestAtomic().
void AtomicProduceThread | ( | int64_t | n, |
int64_t * | value | ||
) |
Definition at line 97 of file lock-benchmark.cc.
Referenced by TestAtomic().
void BoostConsumeThread | ( | int64_t | n, |
int64_t * | value | ||
) |
Definition at line 116 of file lock-benchmark.cc.
References impala::lock_.
Referenced by TestBoost().
void BoostProduceThread | ( | int64_t | n, |
int64_t * | value | ||
) |
Definition at line 122 of file lock-benchmark.cc.
References impala::lock_.
Referenced by TestBoost().
Definition at line 129 of file lock-benchmark.cc.
References TestData< Decimal >::num_consumer_threads, TestData< Decimal >::num_consumes, TestData< Decimal >::num_producer_threads, TestData< Decimal >::num_produces, and TestData< Decimal >::value.
Referenced by TestAtomic(), TestBoost(), TestSpinLock(), and TestUnlocked().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 171 of file lock-benchmark.cc.
References impala::Benchmark::AddBenchmark(), impala::Benchmark::GetMachineInfo(), impala::CpuInfo::Init(), impala::Benchmark::Measure(), impala::name, TestData< Decimal >::num_consumer_threads, TestData< Decimal >::num_consumes, TestData< Decimal >::num_producer_threads, TestData< Decimal >::num_produces, TestAtomic(), TestBoost(), TestSpinLock(), and TestUnlocked().
void SpinLockConsumeThread | ( | int64_t | n, |
int64_t * | value | ||
) |
Definition at line 103 of file lock-benchmark.cc.
References spinlock_.
Referenced by TestSpinLock().
void SpinLockProduceThread | ( | int64_t | n, |
int64_t * | value | ||
) |
Definition at line 109 of file lock-benchmark.cc.
References spinlock_.
Referenced by TestSpinLock().
void TestAtomic | ( | int | batch_size, |
void * | d | ||
) |
Definition at line 153 of file lock-benchmark.cc.
References AtomicConsumeThread(), AtomicProduceThread(), LaunchThreads(), and TestData< Decimal >::value.
Referenced by main().
void TestBoost | ( | int | batch_size, |
void * | d | ||
) |
Definition at line 165 of file lock-benchmark.cc.
References BoostConsumeThread(), BoostProduceThread(), LaunchThreads(), and TestData< Decimal >::value.
Referenced by main().
void TestSpinLock | ( | int | batch_size, |
void * | d | ||
) |
Definition at line 159 of file lock-benchmark.cc.
References LaunchThreads(), SpinLockConsumeThread(), SpinLockProduceThread(), and TestData< Decimal >::value.
Referenced by main().
void TestUnlocked | ( | int | batch_size, |
void * | d | ||
) |
Definition at line 149 of file lock-benchmark.cc.
References LaunchThreads(), UnlockedConsumeThread(), and UnlockedProduceThread().
Referenced by main().
void UnlockedConsumeThread | ( | int64_t | n, |
int64_t * | value | ||
) |
Definition at line 77 of file lock-benchmark.cc.
Referenced by TestUnlocked().
void UnlockedProduceThread | ( | int64_t | n, |
int64_t * | value | ||
) |
Definition at line 84 of file lock-benchmark.cc.
Referenced by TestUnlocked().
mutex lock_ |
Definition at line 72 of file lock-benchmark.cc.
Referenced by impala::ThreadMgr::AddThread(), impala::DataStreamMgr::Cancel(), impala::DataStreamMgr::CreateRecvr(), impala::DataStreamMgr::DeregisterRecvr(), impala::LibCache::DropCache(), impala::DataStreamMgr::FindRecvr(), impala::LibCache::GetCacheEntryInternal(), impala::HdfsFsCache::GetConnection(), impala::LibCache::RemoveEntry(), impala::ThreadMgr::RemoveThread(), impala::LibCache::SetNeedsRefresh(), impala::ThreadMgr::StartInstrumentation(), impala::ThreadMgr::ThreadGroupUrlCallback(), and impala::ThreadMgr::ThreadOverviewUrlCallback().
SpinLock spinlock_ |
Definition at line 73 of file lock-benchmark.cc.
Referenced by SpinLockConsumeThread(), and SpinLockProduceThread().