proxygen
EventBaseBenchmark.cpp File Reference

Go to the source code of this file.

Classes

class  CountedLoopCallback
 

Functions

 BENCHMARK (timeMeasurementsOn, n)
 
 BENCHMARK_RELATIVE (timeMeasurementsOff, n)
 
int main (int argc, char **argv)
 

Function Documentation

BENCHMARK ( timeMeasurementsOn  ,
 
)

Definition at line 39 of file EventBaseBenchmark.cpp.

References c, folly::EventBase::loop(), and folly::EventBase::runInLoop().

39  {
40  EventBase eventBase;
41 
42  while (n--) {
43  CountedLoopCallback c(&eventBase, 10);
44  eventBase.runInLoop(&c);
45  eventBase.loop();
46  }
47 }
void runInLoop(LoopCallback *callback, bool thisIteration=false)
Definition: EventBase.cpp:520
char c
BENCHMARK_RELATIVE ( timeMeasurementsOff  ,
 
)

Definition at line 49 of file EventBaseBenchmark.cpp.

References c, folly::EventBase::loop(), and folly::EventBase::runInLoop().

49  {
50  EventBase eventBase(/* enableTimeMeasurement */ false);
51 
52  while (n--) {
53  CountedLoopCallback c(&eventBase, 10);
54  eventBase.runInLoop(&c);
55  eventBase.loop();
56  }
57 }
char c
int main ( int  argc,
char **  argv 
)

–bm_min_iters=1000000


folly/io/async/test/EventBaseBenchmark.cpp relative time/iter iters/s

timeMeasurementsOn 1.25us 798.33K

timeMeasurementsOff 214.47% 584.04ns 1.71M

Definition at line 70 of file EventBaseBenchmark.cpp.

References folly::runBenchmarks().

70  {
71  gflags::ParseCommandLineFlags(&argc, &argv, true);
72  runBenchmarks();
73 }
void runBenchmarks()
Definition: Benchmark.cpp:456
char ** argv