Skip to content

Commit 1577c7e

Browse files
committed
DPL Analysis: enable cache without prefetching
This give the same results in terms of reduced IOPs, without the problems with the multiple basket branches. It also adds explicitly to the cache all the _size branches. Not yet clear if we need to have ROOT v6.32.06-alice2 as well for this to work correctly.
1 parent 6dd7f9d commit 1577c7e

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

Framework/Core/src/TableTreeHelpers.cxx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -499,14 +499,22 @@ void TreeToTable::addAllColumns(TTree* tree, std::vector<std::string>&& names)
499499
if (mBranchReaders.empty()) {
500500
throw runtime_error("No columns will be read");
501501
}
502-
//tree->SetCacheSize(50000000);
503-
// FIXME: see https://github.com/root-project/root/issues/8962 and enable
504-
// again once fixed.
505-
//tree->SetClusterPrefetch(true);
506-
//for (auto& reader : mBranchReaders) {
507-
// tree->AddBranchToCache(reader->branch());
508-
//}
509-
//tree->StopCacheLearningPhase();
502+
// Was affected by https://github.com/root-project/root/issues/8962
503+
// Re-enabling this seems to cut the number of IOPS in half
504+
tree->SetCacheSize(25000000);
505+
// tree->SetClusterPrefetch(true);
506+
for (auto& reader : mBranchReaders) {
507+
tree->AddBranchToCache(reader->branch());
508+
if (strncmp(reader->branch()->GetName(), "fIndexArray", strlen("fIndexArray")) == 0) {
509+
std::string sizeBranchName = reader->branch()->GetName();
510+
sizeBranchName += "_size";
511+
TBranch* sizeBranch = (TBranch*)tree->GetBranch(sizeBranchName.c_str());
512+
if (sizeBranch) {
513+
tree->AddBranchToCache(sizeBranch);
514+
}
515+
}
516+
}
517+
tree->StopCacheLearningPhase();
510518
}
511519

512520
void TreeToTable::setLabel(const char* label)

0 commit comments

Comments
 (0)