PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
10.01k stars 4.62k forks source link

Optimize Eigen block operations #5974

Closed mvieth closed 8 months ago

mvieth commented 8 months ago

According to https://eigen.tuxfamily.org/dox/group__TutorialBlockOperations.html , Eigen should receive as much information as possible at compile time, to generate optimal machine code. This means specifying the block size as a template parameter (if fixed size), using topLeftCorner if block starts at (0, 0)

larshg commented 8 months ago

Looks good. Did you do any benchmark to see how much it changed?

mvieth commented 8 months ago

Looks good. Did you do any benchmark to see how much it changed?

Not really. I don't expect any orders-of-magnitude speedup to be honest, but the changes were quite easy and straightforward, so even a chance of a speedup seems worth it :smile: And this also sets a better example for future code