proxygen
|
#include <folly/Singleton.h>
#include <iostream>
#include <thread>
#include <folly/Benchmark.h>
#include <folly/Memory.h>
#include <folly/portability/GFlags.h>
Go to the source code of this file.
Classes | |
struct | BenchmarkSingleton |
struct | BenchmarkTag |
struct | GetTag |
struct | TryGetTag |
struct | TryGetFastTag |
Typedefs | |
template<typename T , typename Tag = detail::DefaultTag> | |
using | SingletonBenchmark = Singleton< T, Tag, BenchmarkTag > |
Functions | |
int * | getMeyersSingleton () |
int * | getNormalSingleton () |
void | run4Threads (std::function< void()> f) |
void | normalSingleton (size_t n) |
BENCHMARK (NormalSingleton, n) | |
BENCHMARK (NormalSingleton4Threads, n) | |
void | meyersSingleton (size_t n) |
BENCHMARK (MeyersSingleton, n) | |
BENCHMARK (MeyersSingleton4Threads, n) | |
void | follySingletonRaw (size_t n) |
BENCHMARK (FollySingletonRaw, n) | |
BENCHMARK (FollySingletonRaw4Threads, n) | |
void | follySingletonTryGet (size_t n) |
BENCHMARK (FollySingletonTryGet, n) | |
BENCHMARK (FollySingletonTryGet4Threads, n) | |
void | follySingletonTryGetFast (size_t n) |
BENCHMARK (FollySingletonTryGetFast, n) | |
BENCHMARK (FollySingletonTryGetFast4Threads, n) | |
int | main (int argc, char **argv) |
using SingletonBenchmark = Singleton<T, Tag, BenchmarkTag> |
Definition at line 89 of file SingletonBenchmark.cpp.
BENCHMARK | ( | NormalSingleton | , |
n | |||
) |
BENCHMARK | ( | NormalSingleton4Threads | , |
n | |||
) |
Definition at line 69 of file SingletonBenchmark.cpp.
References normalSingleton(), and run4Threads().
BENCHMARK | ( | MeyersSingleton | , |
n | |||
) |
BENCHMARK | ( | MeyersSingleton4Threads | , |
n | |||
) |
Definition at line 83 of file SingletonBenchmark.cpp.
References meyersSingleton(), and run4Threads().
BENCHMARK | ( | FollySingletonRaw | , |
n | |||
) |
BENCHMARK | ( | FollySingletonRaw4Threads | , |
n | |||
) |
Definition at line 110 of file SingletonBenchmark.cpp.
References follySingletonRaw(), and run4Threads().
BENCHMARK | ( | FollySingletonTryGet | , |
n | |||
) |
BENCHMARK | ( | FollySingletonTryGet4Threads | , |
n | |||
) |
Definition at line 124 of file SingletonBenchmark.cpp.
References follySingletonTryGet(), and run4Threads().
BENCHMARK | ( | FollySingletonTryGetFast | , |
n | |||
) |
Definition at line 134 of file SingletonBenchmark.cpp.
References follySingletonTryGetFast().
BENCHMARK | ( | FollySingletonTryGetFast4Threads | , |
n | |||
) |
Definition at line 138 of file SingletonBenchmark.cpp.
References follySingletonTryGetFast(), and run4Threads().
void follySingletonRaw | ( | size_t | n | ) |
Definition at line 100 of file SingletonBenchmark.cpp.
References folly::Singleton< T, Tag, VaultTag >::get(), and i.
Referenced by BENCHMARK().
void follySingletonTryGet | ( | size_t | n | ) |
Definition at line 114 of file SingletonBenchmark.cpp.
References i, and folly::Singleton< T, Tag, VaultTag >::try_get().
Referenced by BENCHMARK().
void follySingletonTryGetFast | ( | size_t | n | ) |
Definition at line 128 of file SingletonBenchmark.cpp.
References i, and folly::Singleton< T, Tag, VaultTag >::try_get_fast().
Referenced by BENCHMARK().
int* getMeyersSingleton | ( | ) |
Definition at line 34 of file SingletonBenchmark.cpp.
Referenced by meyersSingleton().
int* getNormalSingleton | ( | ) |
Definition at line 40 of file SingletonBenchmark.cpp.
References folly::doNotOptimizeAway(), and normal_singleton_value.
Referenced by normalSingleton().
int main | ( | int | argc, |
char ** | argv | ||
) |
void meyersSingleton | ( | size_t | n | ) |
Definition at line 73 of file SingletonBenchmark.cpp.
References folly::doNotOptimizeAway(), getMeyersSingleton(), and i.
Referenced by BENCHMARK().
void normalSingleton | ( | size_t | n | ) |
Definition at line 59 of file SingletonBenchmark.cpp.
References folly::doNotOptimizeAway(), getNormalSingleton(), and i.
Referenced by BENCHMARK().
void run4Threads | ( | std::function< void()> | f | ) |
SingletonBenchmark<BenchmarkSingleton, GetTag> benchmark_singleton_get |
Definition at line 95 of file SingletonBenchmark.cpp.
SingletonBenchmark<BenchmarkSingleton, TryGetTag> benchmark_singleton_try_get |
Definition at line 96 of file SingletonBenchmark.cpp.
SingletonBenchmark<BenchmarkSingleton, TryGetFastTag> benchmark_singleton_try_get_fast |
Definition at line 98 of file SingletonBenchmark.cpp.
int normal_singleton_value = 0 |
Definition at line 39 of file SingletonBenchmark.cpp.
Referenced by getNormalSingleton().