When pts_norms_squared is provided, the code still clones it with to_vec(), allocating O(num_points) extra memory even though the values are only read. This can be avoided by keeping it as a borrowed slice when present (and only allocating when norms need to be computed).
Originally posted by @Copilot in #933 (comment)
When
pts_norms_squaredis provided, the code still clones it withto_vec(), allocatingO(num_points)extra memory even though the values are only read. This can be avoided by keeping it as a borrowed slice when present (and only allocating when norms need to be computed).Originally posted by @Copilot in #933 (comment)