Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Inline squared distance calculation #290
I look at the function I care about (
From knowing the code I see that distance2d_sqr_pt_pt is called on every point to every centroid (k*n times) on every loop iteration, and is expected to be really fast. The structure gets packed and then unpacked:
after change, disassembly shows that loop got vectorized:
That's basically it.
These need some attention: