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

refactor: faster computation for binary search #3095

Merged
merged 4 commits into from
Apr 11, 2024

Conversation

CarloVarni
Copy link
Collaborator

Faster binary search then std::lower_bound

@CarloVarni CarloVarni added this to the next milestone Apr 11, 2024
@github-actions github-actions bot added Component - Core Affects the Core module Seeding labels Apr 11, 2024
@CarloVarni CarloVarni requested a review from andiwand April 11, 2024 09:42
@andiwand
Copy link
Contributor

@CarloVarni do you have some numbers / plots on how much faster this is?

Would it make sense to put this in some utility function for broader use or would this kill the performance?

@CarloVarni
Copy link
Collaborator Author

Hi @andiwand , it's the red line. This is the average execution time as a function of the size of the collection N. Test performed locally using a vector of doubles

searchTarget

Btw, that piece of code is called around 18 times for each bin in the grid as of now. I am not sure how this will translate in the overall execution time on a tt-bar pu 200

Concerning utility function, I'm afraid this computation is too specific to this use case (and probably this is where it gets the perf boost). The general solution is the std::lower_bound that will use pointers and allow for a custom comparator

Copy link
Contributor

@andiwand andiwand left a comment

Choose a reason for hiding this comment

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

shall we leave this note for future developers?

otherwise looks good to go!

Core/include/Acts/Seeding/Neighbour.hpp Show resolved Hide resolved
Co-authored-by: Andreas Stefl <stefl.andreas@gmail.com>
andiwand
andiwand previously approved these changes Apr 11, 2024
AJPfleger
AJPfleger previously approved these changes Apr 11, 2024
@CarloVarni CarloVarni dismissed stale reviews from AJPfleger and andiwand via ecae5e7 April 11, 2024 12:45
@kodiakhq kodiakhq bot merged commit b9251ca into acts-project:main Apr 11, 2024
51 checks passed
@acts-project-service
Copy link
Collaborator

acts-project-service commented Apr 11, 2024

🔴 Athena integration test results [b9251ca]

Build job with this PR failed!

Please investigate the build job for the pipeline!

@acts-project-service acts-project-service added the Breaks Athena build This PR breaks the Athena build label Apr 11, 2024
@andiwand andiwand modified the milestones: next, v34.0.0 Apr 15, 2024
Ragansu pushed a commit to Ragansu/acts that referenced this pull request Apr 19, 2024
Faster binary search then `std::lower_bound`
EleniXoch pushed a commit to EleniXoch/acts that referenced this pull request May 6, 2024
Faster binary search then `std::lower_bound`
asalzburger pushed a commit to asalzburger/acts that referenced this pull request May 21, 2024
Faster binary search then `std::lower_bound`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaks Athena build This PR breaks the Athena build Component - Core Affects the Core module Seeding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants