From 532bd87864504993e869e048b5ec4e3d5cbc4e05 Mon Sep 17 00:00:00 2001 From: Sandro Wenzel Date: Thu, 12 Nov 2026 16:30:09 +0100 Subject: [PATCH] Avoid InheritsFrom in CCDB object extraction TClass::InheritsFrom("TObject") on an STL collection such as std::vector 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. --- CCDB/src/CcdbApi.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CCDB/src/CcdbApi.cxx b/CCDB/src/CcdbApi.cxx index 6ba38ea34ff50..910e4c8f9d454 100644 --- a/CCDB/src/CcdbApi.cxx +++ b/CCDB/src/CcdbApi.cxx @@ -1008,7 +1008,8 @@ void* CcdbApi::extractFromTFile(TFile& file, TClass const* cl, const char* what) auto result = object; // We need to handle some specific cases as ROOT ties them deeply // to the file they are contained in - if (cl->InheritsFrom("TObject")) { + // IsTObject avoids InheritsFrom, which makes cling instantiate STL collection classes + if (cl->IsTObject()) { // make a clone // detach from the file auto tree = dynamic_cast((TObject*)object);