Make faster TFile::Get

Hi all,
I have a performance question.
Is there any trick one can use when reading a ROOT file via xROOTD which allows to achieve a fast “Get(“dir/Key”)”?
I basically have O(100) of sparse root files on EOS, each of them contains O(20) directories and each directory contains O( 20) TObject i want to grab.

Basically what i need to do is to load a set of 4 different root files and have at hands all the 20x20 objects in a custom bookkeping locally via std::map.
The issue i have is that the Get call is very slow in my “sequential” code and i was wondering if there is any smart caching i can do with TFiles. I can convert each file to a json file but i would like to avoid to do that.

Thanks in advance.


ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


It’s not surprising that remote reading has a long latency. I invite @pcanal to help.

You can try:

auto f = TFile::Open(filename, "CACHEREAD");

or

gEnv->GetValue("TFile.AsyncPrefetching", 1);
auto f = TFile::Open(filename, "CACHEREAD");
auto c = new TFileCacheRead( f, 32*1024*1024 );

or downloading the file then open the local copy.

Cheers,
Philippe.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.