MCPcopy Create free account
hub / github.com/boostorg/histogram / baseline

Function baseline

test/speed_cpp.cpp:36–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34void ignore(const T&) {}
35
36double baseline(unsigned n) {
37 auto r = random_array(n, 0);
38
39 auto best = std::numeric_limits<double>::max();
40 for (unsigned k = 0; k < 20; ++k) {
41 auto t = clock();
42 for (unsigned i = 0; i < n; ++i) {
43 volatile auto x = r[i];
44 ignore(x);
45 }
46 t = clock() - t;
47 best = std::min(best, double(t) / CLOCKS_PER_SEC);
48 }
49 return best;
50}
51
52template <typename Tag, typename Storage>
53double compare_1d(unsigned n, int distrib) {

Callers 1

mainFunction · 0.85

Calls 2

ignoreFunction · 0.85
random_arrayFunction · 0.70

Tested by

no test coverage detected