29 using namespace
folly;
35 static auto ret =
new int(0);
50 std::vector<std::thread>
threads;
51 for (
size_t i = 0;
i < 4; ++
i) {
52 threads.emplace_back(
f);
54 for (
auto& thread : threads) {
60 for (
size_t i = 0;
i < n; ++
i) {
74 for (
size_t i = 0;
i < n; ++
i) {
88 template <
typename T,
typename Tag = detail::DefaultTag>
101 for (
size_t i = 0;
i < n; ++
i) {
115 for (
size_t i = 0;
i < n; ++
i) {
129 for (
size_t i = 0;
i < n; ++
i) {
143 gflags::ParseCommandLineFlags(&argc, &argv,
true);
144 gflags::SetCommandLineOptionWithMode(
145 "bm_min_usec",
"100000", gflags::SET_FLAG_IF_DEFAULT);
int main(int argc, char **argv)
#define FOLLY_GNU_DISABLE_WARNING(warningName)
int * getNormalSingleton()
int normal_singleton_value
BENCHMARK(NormalSingleton, n)
void run4Threads(std::function< void()> f)
void follySingletonTryGet(size_t n)
—— Concurrent Priority Queue Implementation ——
void meyersSingleton(size_t n)
std::vector< std::thread::id > threads
void follySingletonRaw(size_t n)
SingletonBenchmark< BenchmarkSingleton, TryGetFastTag > benchmark_singleton_try_get_fast
int * getMeyersSingleton()
SingletonBenchmark< BenchmarkSingleton, GetTag > benchmark_singleton_get
void normalSingleton(size_t n)
static std::shared_ptr< T > try_get()
SingletonBenchmark< BenchmarkSingleton, TryGetTag > benchmark_singleton_try_get
static folly::ReadMostlySharedPtr< T > try_get_fast()
auto doNotOptimizeAway(const T &datum) -> typename std::enable_if< !detail::DoNotOptimizeAwayNeedsIndirect< T >::value >::type
void follySingletonTryGetFast(size_t n)