Skip to content

Speed up quad_segment_maxima by skipping unneeded lineparam calculation.#305

Merged
christian-rauch merged 1 commit intoAprilRobotics:masterfrom
AustinSchuh:mse_speedup
Dec 29, 2023
Merged

Speed up quad_segment_maxima by skipping unneeded lineparam calculation.#305
christian-rauch merged 1 commit intoAprilRobotics:masterfrom
AustinSchuh:mse_speedup

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
@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