MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / functionCall

Function functionCall

runtime/Perf.cc:469–481  ·  view source on GitHub ↗

Measure the cost of calling a non-inlined function.

Source from the content-addressed store, hash-verified

467
468// Measure the cost of calling a non-inlined function.
469double functionCall()
470{
471 int count = 1000000;
472 uint64_t x = 0;
473 uint64_t start = Cycles::rdtsc();
474 for (int i = 0; i < count; i++) {
475 PerfHelper::plusOne(x);
476 }
477 uint64_t stop = Cycles::rdtsc();
478
479 discard(&count);
480 return Cycles::toSeconds(stop - start)/(count);
481}
482
483double functionDereference()
484{

Callers

nothing calls this directly

Calls 3

rdtscFunction · 0.85
plusOneFunction · 0.85
discardFunction · 0.70

Tested by

no test coverage detected