Skip to content
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

Use move semantics to push TrajectorySeeds into a vector #3693

Merged
merged 1 commit into from May 7, 2014

Conversation

mark-grimes
Copy link

TrajectorySeed has a move constructor (https://github.com/cms-sw/cmssw/blob/CMSSW_7_1_X/DataFormats/TrajectorySeed/interface/TrajectorySeed.h#L65) which previously wasn't used for the vector push.

I haven't done any benchmarking, but each individual push_back should be quite small. At 140 pileup however pixelPairStepSeeds has O(100000) of these push_backs, and that's just one of the tracking steps.

@cmsbuild
Copy link
Contributor

cmsbuild commented May 6, 2014

A new Pull Request was created by @mark-grimes (Mark Grimes) for CMSSW_7_1_X.

Use move semantics to push TrajectorySeeds into a vector

It involves the following packages:

RecoTracker/TkSeedGenerator

@nclopezo, @cmsbuild, @anton-a, @thspeer, @slava77, @Degano can you please review it and eventually sign? Thanks.
@ghellwig, @GiacomoSguazzoni, @rovere, @gpetruc, @cerati, @venturia this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@@ -159,7 +159,7 @@ void SeedFromConsecutiveHitsCreator::buildSeed(
PTrajectoryStateOnDet const & PTraj =
trajectoryStateTransform::persistentState(updatedState, hit->geographicalId().rawId());
TrajectorySeed seed(PTraj,std::move(seedHits),alongMomentum);
if ( !filter || filter->compatible(seed)) seedCollection.push_back(seed);
if ( !filter || filter->compatible(seed)) seedCollection.push_back(std::move(seed));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a different solution could be
seedCollection.emplace_back(PTraj,std::move(seedHits),alongMomentum);
if (filter && (!filter->compatible(seedCollection.back()) seedCollection.pop_back();
in particular if compatible is very likely

@cmsbuild
Copy link
Contributor

cmsbuild commented May 7, 2014

@cmsbuild
Copy link
Contributor

cmsbuild commented May 7, 2014

@anton-a
Copy link

anton-a commented May 7, 2014

is anyone willing to compare the performance of the proposed solution and Vincenzo's alternative or we stick with the original proposal? It would have helped to have some benchmark numbers.

@anton-a
Copy link

anton-a commented May 7, 2014

+1
We will stick with the original proposal and leave further speed up for the future

@cmsbuild
Copy link
Contributor

cmsbuild commented May 7, 2014

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_1_X IBs unless changes (tests are also fine). @nclopezo, @ktf can you please take care of it?

nclopezo added a commit that referenced this pull request May 7, 2014
RecoTracker/TkSeedGenerator -- Use move semantics to push TrajectorySeeds into a vector
@nclopezo nclopezo merged commit 830df8a into cms-sw:CMSSW_7_1_X May 7, 2014
@mark-grimes mark-grimes deleted the moveTrajectorySeed branch August 3, 2015 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants