@memoriesin8bit I'm assuming you've already ensured you don't have any memory allocations (usually pushing into an array) in the ghost collision loop, and have done some basic space partitioning do reduce the search space? If not, I recently had a problem where I needed to find closest pairs of points, and just sorting them into a grid of points and only checking the 9 nearest partitions instead of the entire space saved like 95% of the time. Even basic space partitioning helps searches a lot.