Skip to content

Commit

Permalink
perf: Remove extraneous copies in seedfinder (#953)
Browse files Browse the repository at this point in the history
This is just a tiny little improvement on #905. I noticed that we are
currently using an output iterator function to write some results to a
vector, and then copying that vector over to append it to another,
existing vector. I think it would be (very marginally) quicker and
neater to avoid this extra copy and just have the function take the
insertion iterator of the vector we are planning to write to in the end.
  • Loading branch information
stephenswat committed Aug 20, 2021
1 parent d74d411 commit d04706b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
4 changes: 0 additions & 4 deletions Core/include/Acts/Seeding/Seedfinder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ class Seedfinder {
std::vector<std::pair<
float, std::unique_ptr<const InternalSeed<external_spacepoint_t>>>>
seedsPerSpM;

std::vector<std::pair<
float, std::unique_ptr<const InternalSeed<external_spacepoint_t>>>>
sameTrackSeeds;
};

/// The only constructor. Requires a config object.
Expand Down
8 changes: 1 addition & 7 deletions Core/include/Acts/Seeding/Seedfinder.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,9 @@ void Seedfinder<external_spacepoint_t, platform_t>::createSeedsForGroup(
}
}
if (!state.topSpVec.empty()) {
state.sameTrackSeeds.clear();
m_config.seedFilter->filterSeeds_2SpFixed(
*state.compatBottomSP[b], *spM, state.topSpVec, state.curvatures,
state.impactParameters, Zob,
std::back_inserter(state.sameTrackSeeds));
state.seedsPerSpM.insert(
state.seedsPerSpM.end(),
std::make_move_iterator(state.sameTrackSeeds.begin()),
std::make_move_iterator(state.sameTrackSeeds.end()));
state.impactParameters, Zob, std::back_inserter(state.seedsPerSpM));
}
}
m_config.seedFilter->filterSeeds_1SpFixed(state.seedsPerSpM, outIt);
Expand Down

0 comments on commit d04706b

Please sign in to comment.