Just like BENCHMARK, but prints the time relative to a baseline. The baseline is the most recent BENCHMARK() seen in the current scope. Example:

Synopsis

Declared in <folly/Benchmark.h>

#define BENCHMARK_RELATIVE(name, …​)

Description

// This is the baseline BENCHMARK(insertVectorBegin, n) { vector<int> v; for (unsigned int i = 0; i < n; ++i) { v.insert(v.begin(), 42); } }

BENCHMARK_RELATIVE(insertListBegin, n) { list<int> s; for (unsigned int i = 0; i < n; ++i) { s.insert(s.begin(), 42); } }

Any number of relative benchmark can be associated with a baseline. Another BENCHMARK() occurrence effectively establishes a new baseline.

Parameters

Name

Description

name

The benchmark's name, also used as its function identifier.

Created with MrDocs