-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HistFactory] Disable global histogram registration for HistFactory. #18182
base: master
Are you sure you want to change the base?
Conversation
7b34874
to
7b0297d
Compare
Test Results 19 files 19 suites 4d 11h 37m 54s ⏱️ For more details on these failures, see this check. Results for commit ec75ccc. ♻️ This comment has been updated with latest results. |
TDirectory::TContext dirContext; | ||
std::unique_ptr<TFile> outFile; | ||
gDirectory = nullptr; // Disable global registration of histograms this file. HistFactory places them explicitly later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TDirectory::TContext dirContext; | |
std::unique_ptr<TFile> outFile; | |
gDirectory = nullptr; // Disable global registration of histograms this file. HistFactory places them explicitly later. | |
TDirectory::TContext dirContext{nullptr} // Disable global registration of histograms this file. HistFactory places them explicitly later. | |
std::unique_ptr<TFile> outFile; |
Since the next line does not allocated a TFile
and thus does not change gDirectory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However line 138:
outFile = std::make_unique<TFile>(outputFileName.c_str(), "recreate");
should probably be:
outFile = std::make_unique<TFile>(outputFileName.c_str(), "RECREATE_WITHOUT_GLOBALREGISTRATION") // note: casing does not matter.
gDirectory = nullptr; // Make sure the files does not become the current directory. We do not need TContext here since we have one on the outer scope.
Side note the _WITHOUT_GLOBALREGISTRATION
is probably the only thing strictly necessary for the goal of this PR (i.e. since it is not registered, it is not on the list of Cleanups and thus will not be traversed on delete of the histograms).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I had no idea this option existed! That's really good to know!
Hello, the execution is slightly faster from ~260s to about 230s but it seems most of the time is still spent in the destructors
|
7b0297d
to
18a27e3
Compare
Hello @TomasDado, my attempt at changing it was mostly without effect as pointed out by Philippe. I force-pushed a new version of the commit that should have larger impact. Could you try again, please? |
Unfortunately, it still looks very similar, running time of about 230s:
|
The HistFactory histograms are owned by the HistFactory models, and they are explicitly written to files. Therefore, they should not participate in global directory registration.
18a27e3
to
eeba948
Compare
HistFactory models can suffer from slowdowns of minutes during destruction because the list of cleanups is visited over and over again.
eeba948
to
ec75ccc
Compare
The HistFactory histograms are owned by the HistFactory models, and they are explicitly written to files. Therefore, they should not participate in directory registration.
Fix #18172