-
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
reduce creation of string objects and use char* instead of string #9678
reduce creation of string objects and use char* instead of string #9678
Conversation
A new Pull Request was created by @ngrenz for CMSSW_7_5_X. reduce creation of string objects and use char* instead of string It involves the following packages: SimTracker/TrackerHitAssociation @cmsbuild, @civanch, @mdhildreth can you please review it and eventually sign? Thanks. |
@boudoul FYI |
@@ -99,7 +99,7 @@ void TrackerHitAssociator::makeMaps(const edm::Event& theEvent, const TrackerHit | |||
// The collections are specified via ROUList in the configuration, and can | |||
// be either crossing frames (e.g., mix/g4SimHitsTrackerHitsTIBLowTof) | |||
// or just PSimHits (e.g., g4SimHits/TrackerHitsTIBLowTof) | |||
|
|||
const char* highTag = "HighTof"; |
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.
It would be even better to make this a const char * const
. Then neither the character array nor the pointer would be allowed to change.
@ngrenz Have you profiled the code? |
@makortel I have profiled the same change in CMSSW_7_4_0 with Igprof but not in the version 7_5_X. |
@ngrenz , I would agree with Matti, that this string comparison may be done before the loop lines 108-122. |
@ngrenz Very good, looking forward to your further optimizations. |
thanks all for your comments |
Pull request #9678 was updated. @cmsbuild, @civanch, @mdhildreth can you please check and sign again. |
Pull request #9678 was updated. @cmsbuild, @civanch, @mdhildreth can you please check and sign again. |
+1 |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_5_X IBs once checked with relvals in the development release cycle of CMSSW (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @Degano, @smuzaffar |
+1 |
reduce creation of string objects and use char* instead of string
PR of a work intended to optimize gradually the perfrormance of tracker validation code.
Outputs are supposed to be unchanged.
Any comments and suggestions are welcome -more optimizations will follow in the near future