Don't scan+apply every setOldestVersion call
This commit is contained in:
16
Bench.cpp
16
Bench.cpp
@@ -3,11 +3,11 @@
|
||||
#include <nanobench.h>
|
||||
|
||||
void monotonicallyIncreasing() {
|
||||
constexpr int kWindow = 100;
|
||||
constexpr int kWindow = 1000;
|
||||
ankerl::nanobench::Bench bench;
|
||||
Facade facade{0};
|
||||
|
||||
bench.minEpochIterations(1000);
|
||||
bench.minEpochIterations(kWindow * 10);
|
||||
|
||||
bench.warmup(kWindow).run("monotonically increasing", [&] {
|
||||
const int64_t remove = __builtin_bswap64(facade.getVersion() - kWindow);
|
||||
@@ -29,18 +29,6 @@ void monotonicallyIncreasing() {
|
||||
const auto end = facade.versioned.end(v);
|
||||
auto iter = begin;
|
||||
|
||||
bench.run("scan", [&] {
|
||||
for (iter = begin; iter != end; ++iter) {
|
||||
}
|
||||
});
|
||||
|
||||
bench.run("reverse scan", [&] {
|
||||
iter = end;
|
||||
do {
|
||||
--iter;
|
||||
} while (iter != begin);
|
||||
});
|
||||
|
||||
bench.run("deref", [&] { bench.doNotOptimizeAway(*iter); });
|
||||
|
||||
iter = begin;
|
||||
|
Reference in New Issue
Block a user