proxygen
CoroBenchmarkNRVO.cpp File Reference
#include <folly/Benchmark.h>
#include <thread>

Go to the source code of this file.

Classes

struct  ExpensiveCopy
 

Functions

ExpensiveCopy nestedCalls (size_t times)
 
void NRVO (size_t times, size_t iters)
 
 BENCHMARK (NRVOOneAwait, iters)
 
 BENCHMARK (NRVOTenAwaits, iters)
 
int main (int argc, char **argv)
 

Function Documentation

BENCHMARK ( NRVOOneAwait  ,
iters   
)

Definition at line 208 of file CoroBenchmarkNRVO.cpp.

References NRVO().

Referenced by ExpensiveCopy::ExpensiveCopy().

208  {
209  NRVO(1, iters);
210 }
void NRVO(size_t times, size_t iters)
BENCHMARK ( NRVOTenAwaits  ,
iters   
)

Definition at line 212 of file CoroBenchmarkNRVO.cpp.

References NRVO().

212  {
213  NRVO(10, iters);
214 }
void NRVO(size_t times, size_t iters)
int main ( int  argc,
char **  argv 
)

Definition at line 216 of file CoroBenchmarkNRVO.cpp.

References folly::runBenchmarks().

216  {
217  gflags::ParseCommandLineFlags(&argc, &argv, true);
219  return 0;
220 }
void runBenchmarks()
Definition: Benchmark.cpp:456
char ** argv
ExpensiveCopy nestedCalls ( size_t  times)

Definition at line 193 of file CoroBenchmarkNRVO.cpp.

Referenced by NRVO().

193  {
194  ExpensiveCopy ret;
195  if (times > 0) {
196  ret = nestedCalls(times - 1);
197  }
198 
199  return ret;
200 }
ExpensiveCopy nestedCalls(size_t times)
Future< Unit > times(const int n, F &&thunk)
Definition: Future-inl.h:2348
void NRVO ( size_t  times,
size_t  iters 
)

Definition at line 202 of file CoroBenchmarkNRVO.cpp.

References nestedCalls().

Referenced by BENCHMARK().

202  {
203  for (size_t iter = 0; iter < iters; ++iter) {
205  }
206 }
ExpensiveCopy nestedCalls(size_t times)
Future< Unit > times(const int n, F &&thunk)
Definition: Future-inl.h:2348