proxygen
benchmark_impl.h File Reference
#include <functional>
#include <folly/Function.h>

Go to the source code of this file.

Functions

void BM_fn_ptr_invoke_impl (int iters, void(*fn)())
 
void BM_std_function_invoke_impl (int iters, const std::function< void()> &fn)
 
void BM_Function_invoke_impl (int iters, const folly::Function< void() const > &fn)
 
void BM_mem_fn_invoke_impl (int iters, TestClass *tc, void(TestClass::*memfn)())
 
void BM_virtual_fn_invoke_impl (int iters, VirtualClass *vc)
 
void BM_fn_ptr_invoke_inlined_impl (int iters, void(*fn)())
 
template<typename T >
void BM_invoke_fn_template_impl (int iters, const T &fn)
 

Function Documentation

void BM_fn_ptr_invoke_impl ( int  iters,
void(*)()  fn 
)

Definition at line 26 of file benchmark_impl.cpp.

Referenced by BENCHMARK().

26  {
27  for (int n = 0; n < iters; ++n) {
28  fn();
29  }
30 }
void BM_fn_ptr_invoke_inlined_impl ( int  iters,
void(*)()  fn 
)
inline

Definition at line 40 of file benchmark_impl.h.

Referenced by BENCHMARK().

40  {
41  for (int n = 0; n < iters; ++n) {
42  fn();
43  }
44 }
void BM_Function_invoke_impl ( int  iters,
const folly::Function< void() const > &  fn 
)

Definition at line 38 of file benchmark_impl.cpp.

Referenced by BENCHMARK().

40  {
41  for (int n = 0; n < iters; ++n) {
42  fn();
43  }
44 }
template<typename T >
void BM_invoke_fn_template_impl ( int  iters,
const T fn 
)

Definition at line 49 of file benchmark_impl.h.

Referenced by BENCHMARK().

49  {
50  for (int n = 0; n < iters; ++n) {
51  fn();
52  }
53 }
void BM_mem_fn_invoke_impl ( int  iters,
TestClass tc,
void(TestClass::*)()  memfn 
)

Definition at line 46 of file benchmark_impl.cpp.

Referenced by BENCHMARK().

49  {
50  for (int n = 0; n < iters; ++n) {
51  (tc->*memfn)();
52  }
53 }
void BM_std_function_invoke_impl ( int  iters,
const std::function< void()> &  fn 
)

Definition at line 32 of file benchmark_impl.cpp.

Referenced by BENCHMARK().

32  {
33  for (int n = 0; n < iters; ++n) {
34  fn();
35  }
36 }
void BM_virtual_fn_invoke_impl ( int  iters,
VirtualClass vc 
)

Definition at line 55 of file benchmark_impl.cpp.

References VirtualClass::doNothing().

Referenced by BENCHMARK().

55  {
56  for (int n = 0; n < iters; ++n) {
57  vc->doNothing();
58  }
59 }
virtual void doNothing()