prefetch btree nodes when walking a tree

This commit is contained in:
Joe Thornber
2014-07-25 16:32:59 +01:00
parent 11469a2fda
commit ecb6bee2b2
4 changed files with 17 additions and 6 deletions

View File

@@ -827,7 +827,10 @@ namespace persistent_data {
// FIXME: use a switch statement
if (o.get_type() == INTERNAL) {
if (v.visit_internal(loc, o))
if (v.visit_internal(loc, o)) {
for (unsigned i = 0; i < o.get_nr_entries(); i++)
tm_->prefetch(o.value_at(i));
for (unsigned i = 0; i < o.get_nr_entries(); i++) {
node_location loc2(loc);
@@ -836,6 +839,7 @@ namespace persistent_data {
walk_tree(v, loc2, o.value_at(i));
}
}
} else if (loc.path.size() < Levels - 1) {
if (v.visit_internal_leaf(loc, o))