proxygen
FingerprintBenchmark.cpp File Reference
#include <random>
#include <folly/Benchmark.h>
#include <folly/Fingerprint.h>
#include <folly/Format.h>
#include <folly/detail/SlowFingerprint.h>

Go to the source code of this file.

Macros

#define BM(name, min, max)
 

Functions

int main (int argc, char **argv)
 

Macro Definition Documentation

#define BM (   name,
  min,
  max 
)
Value:
for (size_t i = min; i <= max; i *= 2) { \
__FILE__, sformat("{}_{}", #name, i).c_str(), [=](int iters) { \
name(iters, i); \
return iters; \
}); \
}
LogLevel max
Definition: LogLevel.cpp:31
std::string sformat(StringPiece fmt, Args &&...args)
Definition: Format.h:280
const char * name
Definition: http_parser.c:437
LogLevel min
Definition: LogLevel.cpp:30
std::enable_if< boost::function_types::function_arity< decltype(&Lambda::operator())>::value==2 >::type addBenchmark(const char *file, const char *name, Lambda &&lambda)
Definition: Benchmark.h:172

Referenced by main().

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 126 of file FingerprintBenchmark.cpp.

References BM, and folly::runBenchmarks().

126  {
127  gflags::ParseCommandLineFlags(&argc, &argv, true);
128 #define BM(name, min, max) \
129  for (size_t i = min; i <= max; i *= 2) { \
130  addBenchmark( \
131  __FILE__, sformat("{}_{}", #name, i).c_str(), [=](int iters) { \
132  name(iters, i); \
133  return iters; \
134  }); \
135  }
136  BM(fastFingerprintIds64, 1, kMaxIds)
137  BM(slowFingerprintIds64, 1, kMaxIds)
138  BM(fastFingerprintIds96, 1, kMaxIds)
139  BM(fastFingerprintIds128, 1, kMaxIds)
140  BM(fastFingerprintTerms64, 1, kMaxTerms)
141  BM(slowFingerprintTerms64, 1, kMaxTerms)
142  BM(fastFingerprintTerms96, 1, kMaxTerms)
143  BM(fastFingerprintTerms128, 1, kMaxTerms)
144 #undef BM
145 
146  initialize();
147  runBenchmarks();
148  return 0;
149 }
void runBenchmarks()
Definition: Benchmark.cpp:456
#define BM(name, min, max)
char ** argv