I have a function that is called with the name of a root file and a path to a directory within that file. The function loads the file and returns a list of objects in the TDirectoryFile. I use this information to extend tab-completion to root files.
The annoying thing is that it takes ~0.5 seconds to load root, look in the file, and spit back a list of objects. This isn’t a huge problem, but given how comprehensive ROOT is, it wouldn’t surprise me if there was some way of making the process much faster. So is the delay something inherent in opening ROOT files, or can I speed this up somehow?
Are you calling the executable called ‘root’ or ‘root.exe’? Are you using a debug or optimized build of ROOT?
I’m not calling either of those. I’m just including root as a library in another executable. Unfortunately, just linking to root seems to slow down functions that would otherwise take negligible time.
[quote]The annoying thing is that it takes ~0.5 seconds to load root, look in the file, and spit back a list of objects.[/quote]I would expect most of this time being in the ‘load root’ part, which should be a one-time-per-process thing. Unless there is a lot object in the file, “look in the file, and spit back a list of objects.” should be fast … the other slowdown I could think of would also be mostly one time: when opening a file, ROOT will autoload libraries containing the implementation for the classes of the object in the file.
If this assumption do not hold (i.e. the .5s is a one-time-per-process thing), then I would need to see what call you actually make and whether the ROOT file is local or remote.