proxygen
HashBenchmark.cpp File Reference
#include <folly/hash/Hash.h>
#include <stdint.h>
#include <deque>
#include <random>
#include <string>
#include <vector>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/Format.h>
#include <folly/Preprocessor.h>
#include <folly/portability/GFlags.h>

Go to the source code of this file.

Classes

struct  detail::SpookyHashV2
 
struct  detail::FNV64
 

Namespaces

 detail
 

Macros

#define BENCHMARK_HASH(HASHER)   detail::addHashBenchmark<detail::HASHER>(FB_STRINGIZE(HASHER));
 

Functions

std::vector< uint8_tdetail::randomBytes (size_t n)
 
template<class Hasher >
void detail::bmHasher (Hasher hasher, size_t k, size_t iters)
 
template<class Hasher >
void detail::addHashBenchmark (const std::string &name)
 
int main (int argc, char **argv)
 

Variables

std::vector< uint8_tdetail::benchData = randomBytes(1 << 20)
 

Macro Definition Documentation

#define BENCHMARK_HASH (   HASHER)    detail::addHashBenchmark<detail::HASHER>(FB_STRINGIZE(HASHER));

Referenced by main().

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 87 of file HashBenchmark.cpp.

References BENCHMARK_HASH, k, folly::runBenchmarks(), s, and folly::detail::distributed_mutex::time().

87  {
88  gflags::ParseCommandLineFlags(&argc, &argv, true);
89  google::InitGoogleLogging(argv[0]);
90 
91  std::deque<std::string> names; // Backing for benchmark names.
92 
93 #define BENCHMARK_HASH(HASHER) \
94  detail::addHashBenchmark<detail::HASHER>(FB_STRINGIZE(HASHER));
95 
96  BENCHMARK_HASH(SpookyHashV2);
97  BENCHMARK_HASH(FNV64);
98 
99 #undef BENCHMARK_HASH
100 
102 
103  return 0;
104 }
#define BENCHMARK_HASH(HASHER)
void runBenchmarks()
Definition: Benchmark.cpp:456
char ** argv