-
Notifications
You must be signed in to change notification settings - Fork 4.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
Avoid unnecessary locks in ROOT function GetBaseClassOffset() #11441
Conversation
A new Pull Request was created by @wmtan for CMSSW_7_6_X. Avoid unnecessary locks in ROOT function GetBaseClassOffset() It involves the following packages: DataFormats/Common @cmsbuild, @smuzaffar, @Dr15Jones, @monttj, @vadler can you please review it and eventually sign? Thanks. |
@davidlange6 The changes to analysis code consist entirely of adding two missing std includes that were made visible by removing unnecessary includes in the framework. So, this PR should not be held up by a late analysis signature. |
@@ -2,6 +2,7 @@ | |||
#include <algorithm> | |||
#include <iterator> | |||
#include <iostream> | |||
#include <string.h> |
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.
Why the C header? Wouldn't <cstring>
be better?
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.
Yes, cstring is better.
91c739a
to
7b60ff6
Compare
Pull request #11441 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @monttj, @vadler can you please check and sign again. |
@cmsbuild please test |
The tests are being triggered in jenkins. |
+1 |
@smuzaffar is this test still running? |
Avoid unnecessary locks in ROOT function GetBaseClassOffset()
The ROOT function GetBaseClassOffset() does locking that seriously hurts threading efficiency, especially in analysis jobs using pat::. In the vast majority of the cases (in fact in all cases so far observed), the actual offset to the base class object from the derived class object was 0.
This PR replaces GetBaseClassOffset() with a call to a function of a class template that returns 0 by default. In cases where the actual offset is non-zero, the class can be specialized to return the proper value. In cases where the true offset is non-zero, and the class has not been properly specialized, a segfault should result, which will be noticed.