-
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
[RF] Remove safeDeleteList functionality of RooAbsCollection #9685
Conversation
This is presumbaly a bit controversial. safeDeleteList remove elements in order in a RooAbsCollection, starting with the ones that only have clients and no servers. This is a slow process, and takes 25% of CPU time on large workspace manipulation workflows, as it takes place at each workspace::import call. It can also lead to slow ~RooWorkspace. The point is, I don't think this logic is needed at all. ~RooAbsArg takes care of properly breaking all the client-server links, both uplinks and downlinks, for every object. I couldn't find a logical case where a crash would occur if the safeDeleteList logic were to be removed. All RooFit tests pass after this patch. No problem for my heavy workspace manipulation worflows either.
Can one of the admins verify this patch? |
If it works, it's all-the-more good to have complicated destructor magic out of the way. |
@phsft-bot build |
Starting build on |
By now, I think that the breaking of the links came after this destructor magic. You might be right that this is not needed, any more. I suggest to put it in master and see if the address sanitizer build blows up. |
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
Hi @gartrog, thanks for this! I agree that the order doesn't matter, as the RooAbsArg destructor is taking care that there are no dangling pointers in the client and server list. If the ASAN build doesn't complain after merging this, the PR should also be backported to 6.26. It would be a waste to have this nice speedup not in the release. |
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.
Just one little request: can you please rename safeDeleteList to deleteList now? And adapt the function documentation to make sense even after the "safe" deletion is removed?
Should be done @guitargeek |
Thanks a lot! |
@phsft-bot build |
Starting build on |
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.
LGTM, thank you very much! It's about time that this overhead gets removed.
This is presumbaly a bit controversial.
safeDeleteList remove elements in order in a RooAbsCollection,
starting with the ones that only have clients and no servers.
This is a slow process, and takes 25% of CPU time on large workspace
manipulation workflows, as it takes place at each workspace::import
call. It can also lead to slow ~RooWorkspace.
The point is, I don't think this logic is needed at all.
~RooAbsArg takes care of properly breaking all the client-server links,
both uplinks and downlinks, for every object. I couldn't find a logical
case where a crash would occur if the safeDeleteList logic were to be
removed.
All RooFit tests pass after this patch. No problem for my heavy
workspace manipulation worflows either.