Scan and remove old entries in addMutations
This commit is contained in:
@@ -7,6 +7,8 @@ void monotonicallyIncreasing() {
|
||||
ankerl::nanobench::Bench bench;
|
||||
Facade facade{0};
|
||||
|
||||
bench.minEpochIterations(1000);
|
||||
|
||||
bench.warmup(kWindow).run("monotonically increasing", [&] {
|
||||
const int64_t remove = __builtin_bswap64(facade.getVersion() - kWindow);
|
||||
const int64_t next = __builtin_bswap64(facade.getVersion());
|
||||
@@ -18,6 +20,8 @@ void monotonicallyIncreasing() {
|
||||
};
|
||||
facade.addMutations(mutations, sizeof(mutations) / sizeof(mutations[0]),
|
||||
facade.getVersion() + 1);
|
||||
facade.setOldestVersion(
|
||||
std::max<int64_t>(0, facade.getVersion() - kWindow));
|
||||
});
|
||||
|
||||
const auto v = facade.getVersion() - kWindow / 2;
|
||||
@@ -25,7 +29,6 @@ void monotonicallyIncreasing() {
|
||||
const auto end = facade.versioned.end(v);
|
||||
auto iter = begin;
|
||||
|
||||
// Slow because all the clears from old versions are still around.
|
||||
bench.run("scan", [&] {
|
||||
for (iter = begin; iter != end; ++iter) {
|
||||
}
|
||||
|
Reference in New Issue
Block a user