-
Notifications
You must be signed in to change notification settings - Fork 171
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: Remove quick math helpers #3701
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
paulgessinger
approved these changes
Oct 9, 2024
Quality Gate passedIssues Measures |
acts-project-service
added
the
Fails Athena tests
This PR causes a failure in the Athena tests
label
Oct 9, 2024
kodiakhq bot
pushed a commit
that referenced
this pull request
Oct 10, 2024
Replace `std::hypot` with `std::sqrt` in a couple of occasions in Core. This is numerically less accurate but much faster which is preferable for seeding and propagation. blocked by - #3701 --- This pull request focuses on optimizing mathematical calculations by replacing `std::hypot` with more efficient alternatives like `std::sqrt` and `Eigen`'s `norm` method. These changes aim to improve performance and maintain code consistency across various files. Mathematical Optimization: * [`Core/include/Acts/EventData/GenericFreeTrackParameters.hpp`](diffhunk://#diff-35a3d07a1eb05110c620e3cdbc38968456e66270c9f9460472f49e65d8b43acdL157-R162): Replaced `std::hypot` with `std::sqrt` for calculating `transverseMagnitude` and `magnitude`. * [`Core/include/Acts/Propagator/EigenStepperDenseExtension.hpp`](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL111-R111): Replaced multiple instances of `std::hypot` with `std::sqrt` for various calculations, including `tKi`, `dtp1dl`, `dtp2dl`, `dtp3dl`, `dtp4dl`, and `energy`. [[1]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL111-R111) [[2]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL125-R125) [[3]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL170-R179) [[4]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL335-R359) [[5]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL379-R385) [[6]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL433-R439) * [`Core/include/Acts/Propagator/StraightLineStepper.hpp`](diffhunk://#diff-15c3275a0d5f03483637d29160965a5e05496a788223d9e20f8b3ef225617c8aL338-R341): Replaced `std::hypot` with `std::sqrt` for calculating `dtds` and `prop_state.stepping.derivative`. [[1]](diffhunk://#diff-15c3275a0d5f03483637d29160965a5e05496a788223d9e20f8b3ef225617c8aL338-R341) [[2]](diffhunk://#diff-15c3275a0d5f03483637d29160965a5e05496a788223d9e20f8b3ef225617c8aL427-R428) * [`Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp`](diffhunk://#diff-1d63df6364bcd57d6eae717e4c8dea355f07a36f5fca41b0e9fefdbf3224c0a0L245-R249): Replaced `std::hypot` with `std::sqrt` for calculating `invTanTheta` and `qOverPt`. [[1]](diffhunk://#diff-1d63df6364bcd57d6eae717e4c8dea355f07a36f5fca41b0e9fefdbf3224c0a0L245-R249) [[2]](diffhunk://#diff-1d63df6364bcd57d6eae717e4c8dea355f07a36f5fca41b0e9fefdbf3224c0a0L280-R279) * [`Core/include/Acts/Utilities/VectorHelpers.hpp`](diffhunk://#diff-451e964d88f3d2d27ff239dade951924824ee73f885ef4044b5cea0861bfba40L76-R76): Replaced `std::hypot` with `Eigen`'s `norm` method for calculating the perpendicular distance. Additional changes include similar optimizations in other files to ensure consistency and performance improvements across the codebase.
Rosie-Hasan
pushed a commit
to Rosie-Hasan/acts
that referenced
this pull request
Nov 13, 2024
This has proven not to be useful as `std` math functions are not really a bottleneck in our current code. I propose to remove them here. If they become useful in the future we can just bring them back from here.
Rosie-Hasan
pushed a commit
to Rosie-Hasan/acts
that referenced
this pull request
Nov 13, 2024
Replace `std::hypot` with `std::sqrt` in a couple of occasions in Core. This is numerically less accurate but much faster which is preferable for seeding and propagation. blocked by - acts-project#3701 --- This pull request focuses on optimizing mathematical calculations by replacing `std::hypot` with more efficient alternatives like `std::sqrt` and `Eigen`'s `norm` method. These changes aim to improve performance and maintain code consistency across various files. Mathematical Optimization: * [`Core/include/Acts/EventData/GenericFreeTrackParameters.hpp`](diffhunk://#diff-35a3d07a1eb05110c620e3cdbc38968456e66270c9f9460472f49e65d8b43acdL157-R162): Replaced `std::hypot` with `std::sqrt` for calculating `transverseMagnitude` and `magnitude`. * [`Core/include/Acts/Propagator/EigenStepperDenseExtension.hpp`](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL111-R111): Replaced multiple instances of `std::hypot` with `std::sqrt` for various calculations, including `tKi`, `dtp1dl`, `dtp2dl`, `dtp3dl`, `dtp4dl`, and `energy`. [[1]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL111-R111) [[2]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL125-R125) [[3]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL170-R179) [[4]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL335-R359) [[5]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL379-R385) [[6]](diffhunk://#diff-3f30fd6031431b17dcd4e580cd73c202210417e80738cbcc76003b413be13c8dL433-R439) * [`Core/include/Acts/Propagator/StraightLineStepper.hpp`](diffhunk://#diff-15c3275a0d5f03483637d29160965a5e05496a788223d9e20f8b3ef225617c8aL338-R341): Replaced `std::hypot` with `std::sqrt` for calculating `dtds` and `prop_state.stepping.derivative`. [[1]](diffhunk://#diff-15c3275a0d5f03483637d29160965a5e05496a788223d9e20f8b3ef225617c8aL338-R341) [[2]](diffhunk://#diff-15c3275a0d5f03483637d29160965a5e05496a788223d9e20f8b3ef225617c8aL427-R428) * [`Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp`](diffhunk://#diff-1d63df6364bcd57d6eae717e4c8dea355f07a36f5fca41b0e9fefdbf3224c0a0L245-R249): Replaced `std::hypot` with `std::sqrt` for calculating `invTanTheta` and `qOverPt`. [[1]](diffhunk://#diff-1d63df6364bcd57d6eae717e4c8dea355f07a36f5fca41b0e9fefdbf3224c0a0L245-R249) [[2]](diffhunk://#diff-1d63df6364bcd57d6eae717e4c8dea355f07a36f5fca41b0e9fefdbf3224c0a0L280-R279) * [`Core/include/Acts/Utilities/VectorHelpers.hpp`](diffhunk://#diff-451e964d88f3d2d27ff239dade951924824ee73f885ef4044b5cea0861bfba40L76-R76): Replaced `std::hypot` with `Eigen`'s `norm` method for calculating the perpendicular distance. Additional changes include similar optimizations in other files to ensure consistency and performance improvements across the codebase.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component - Core
Affects the Core module
Fails Athena tests
This PR causes a failure in the Athena tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This has proven not to be useful as
std
math functions are not really a bottleneck in our current code. I propose to remove them here. If they become useful in the future we can just bring them back from here.