Why sort by distance?  Why not distanced squared?  Avoid the square roots.  Fast by default I hear.