Skip to content

Commit

Permalink
Merge pull request #4180 from mark-grimes/removeSeedGeneratorReserve
Browse files Browse the repository at this point in the history
Remove vector reserve in SeedGeneratorFromRegionHits
  • Loading branch information
cmsbuild committed Jun 10, 2014
2 parents 638695c + c7bf6d8 commit bd8b936
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ void SeedGeneratorFromRegionHits::run(TrajectorySeedCollection & seedCollection,
const OrderedSeedingHits & hitss = theHitsGenerator->run(region, ev, es);

unsigned int nHitss = hitss.size();
if (seedCollection.empty()) seedCollection.reserve(nHitss); // don't do multiple reserves in the case of multiple regions: it would make things even worse
// as it will cause N re-allocations instead of the normal log(N)/log(2)
// Modified 10/Jun/2014 Mark Grimes - At 140 pileup this reserve massively overestimates
// the amount of memory required. Removing it doesn't appear to slow down the algorithm
// noticeably.
//if (seedCollection.empty()) seedCollection.reserve(nHitss); // don't do multiple reserves in the case of multiple regions: it would make things even worse
// // as it will cause N re-allocations instead of the normal log(N)/log(2)
for (unsigned int iHits = 0; iHits < nHitss; ++iHits) {
const SeedingHitSet & hits = hitss[iHits];
if (!theComparitor || theComparitor->compatible(hits, region) ) {
Expand Down

0 comments on commit bd8b936

Please sign in to comment.