Skip to content

Commit 532bd87

Browse files
committed
Avoid InheritsFrom in CCDB object extraction
TClass::InheritsFrom("TObject") on an STL collection such as std::vector<o2::detectors::AlignParam> makes cling instantiate the class and read a large part of the ROOT module data. IsTObject() gives the same answer without this. In o2-sim, which fetches the alignment this way, this saves about 150 MB (16 workers, peak PSS 6384 -> 6215 MB) with bit-identical hits.
1 parent f611478 commit 532bd87

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎CCDB/src/CcdbApi.cxx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,8 @@ void* CcdbApi::extractFromTFile(TFile& file, TClass const* cl, const char* what)
10081008
auto result = object;
10091009
// We need to handle some specific cases as ROOT ties them deeply
10101010
// to the file they are contained in
1011-
if (cl->InheritsFrom("TObject")) {
1011+
// IsTObject avoids InheritsFrom, which makes cling instantiate STL collection classes
1012+
if (cl->IsTObject()) {
10121013
// make a clone
10131014
// detach from the file
10141015
auto tree = dynamic_cast<TTree*>((TObject*)object);

0 commit comments

Comments
 (0)