AprilRobotics / apriltag

AprilTag is a visual fiducial system popular for robotics research.
https://april.eecs.umich.edu/software/apriltag
Other
1.47k stars 522 forks source link

Speed up quad_segment_maxima by skipping unneeded lineparam calculation. #305

Closed AustinSchuh closed 6 months ago

AustinSchuh commented 6 months ago

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.