proxygen
ThreadCachedIntsBenchmark.cpp File Reference

Go to the source code of this file.

Functions

void runTest (int iters)
 
 BENCHMARK_DRAW_LINE ()
 
 BENCHMARK (Increment, iters)
 
int main (int argc, char *argv[])
 

Function Documentation

BENCHMARK ( Increment  ,
iters   
)

Definition at line 37 of file ThreadCachedIntsBenchmark.cpp.

References folly::BENCHMARK_DRAW_LINE(), and runTest().

37  {
38  runTest(iters);
39 }
void runTest(int iters)
BENCHMARK_DRAW_LINE ( )
int main ( int  argc,
char *  argv[] 
)

Definition at line 42 of file ThreadCachedIntsBenchmark.cpp.

References folly::runBenchmarks().

42  {
43  gflags::ParseCommandLineFlags(&argc, &argv, true);
45 
46  return 0;
47 }
void runBenchmarks()
Definition: Benchmark.cpp:456
char ** argv
void runTest ( int  iters)

Definition at line 22 of file ThreadCachedIntsBenchmark.cpp.

References folly::BENCHMARK_DRAW_LINE(), folly::BenchmarkSuspender::dismiss(), and i.

Referenced by BENCHMARK().

22  {
23  BenchmarkSuspender susp;
24 
25  detail::ThreadCachedInts<void> counters;
26  counters.increment(0);
27 
28  susp.dismiss();
29 
30  // run the test loop
31  for (int i = 0; i < iters; i++) {
32  counters.increment(0);
33  }
34 }