Commit 9b603496 authored by Philipp Götze's avatar Philipp Götze
Browse files

Use 'drain' instead of a transaction for preparing the benchmarks

parent 50f654e6
Pipeline #277 failed with stages
in 7 minutes and 54 seconds
......@@ -32,13 +32,14 @@ static void BM_TreeGet(benchmark::State &state) {
pop = pool<root>::create(path, LAYOUT, POOL_SIZE);
transaction::run(pop, [&] {
pop.root()->tree = make_persistent<TreeType>();
});
});
insert(pop.root()->tree);
} else {
LOG("Warning: " << path << " already exists");
pop = pool<root>::open(path, LAYOUT);
hybridWrapper.recover(*pop.root()->tree);
}
pop.drain();
const auto tree = pop.root()->tree;
auto &treeRef = *tree;
......
......@@ -46,6 +46,7 @@ static void BM_TreeInsert(benchmark::State &state) {
pop.root()->tree = make_persistent<TreeType>();
});
}
pop.drain();
const auto tree = pop.root()->tree;
auto &treeRef = *tree;
......
......@@ -32,15 +32,14 @@ static void BM_TreeScan(benchmark::State &state) {
pop = pool<root>::create(path, LAYOUT, POOL_SIZE);
transaction::run(pop, [&] {
pop.root()->tree = make_persistent<TreeType>();
insert(pop.root()->tree);
});
insert(pop.root()->tree);
} else {
LOG("Warning: " << path << " already exists");
pop = pool<root>::open(path, LAYOUT);
transaction::run(pop, [&] {
hybridWrapper.recover(*pop.root()->tree);
});
hybridWrapper.recover(*pop.root()->tree);
}
pop.drain(); ///< wait for preparations to be persistent
auto tree = pop.root()->tree;
auto &treeRef = *tree;
auto node = treeRef.rootNode;
......
......@@ -46,6 +46,7 @@ static void BM_TreeSplit(benchmark::State &state) {
pop.root()->tree = make_persistent<TreeType>();
});
}
pop.drain();
auto tree = pop.root()->tree;
auto &treeRef = *tree;
auto &leaf = treeRef.rootNode.leaf;
......
......@@ -32,13 +32,14 @@ static void BM_TreeTraverse(benchmark::State &state) {
pop = pool<root>::create(path, LAYOUT, POOL_SIZE);
transaction::run(pop, [&] {
pop.root()->tree = make_persistent<TreeType>();
});
});
insert(pop.root()->tree);
} else {
LOG("Warning: " << path << " already exists");
pop = pool<root>::open(path, LAYOUT);
hybridWrapper.recover(*pop.root()->tree);
}
pop.drain();
auto tree = pop.root()->tree;
auto &treeRef = *tree;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment