Skip to content

Conversation

dittmer
Copy link
Contributor

@dittmer dittmer commented Sep 25, 2023

Closing a rootfile with many histograms can take a long time; this can be sped up by using ROOT.gROOT.GetListOfFiles().Remove() (see https://root-forum.cern.ch/t/tfile-close-slow/24179)
This is already done within haddfast, but not when opening / closing the rootfile when doing histogram postprocessing
Since ROOT is not deleting the objects in memory when the file closes, they must be deleted manually instead

Tested and saw minor improvement in closing speed (30s to 6s) for a histogram file with 139k histograms; however analyses with more histograms could see larger improvement. If there are no such analyses, I will close this PR. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant