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

Speed up quad_segment_maxima by skipping unneeded lineparam calculation. #305

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

AustinSchuh
Copy link
Contributor

In quad_segment_maxima, nothing uses params23 and params30, but these are calculated anyways. The compiler isn't smart enough to know that there are no side effects, so it doesn't skip calculating them.

On my test box, this takes
fit quads to clusters 8.896000 ms 23.968000 ms
to
fit quads to clusters 8.429000 ms 23.490000 ms

which is measurable.

In quad_segment_maxima, nothing uses params23 and params30, but these
are calculated anyways.  The compiler isn't smart enough to know that
there are no side effects, so it doesn't skip calculating them.

On my test box, this takes
            fit quads to clusters        8.896000 ms       23.968000 ms
to
            fit quads to clusters        8.429000 ms       23.490000 ms

which is measurable.

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
@christian-rauch christian-rauch merged commit 5e58950 into AprilRobotics:master Dec 29, 2023
10 checks passed
@AustinSchuh AustinSchuh deleted the mse_speedup branch December 29, 2023 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants