[casey talked about complexity]
This is precisely the problem I have run into in one of my
in-dev games--iterating over large arrays once per frame. Actually, it
is basically a collision detection algorithm--I have two arrays, both
containing 3D points. The points in one array must be tested with the
points in the other to see how close they are. If they are close
enough, there is a collision. Naturally, this means that for every
point in one array, the other array must be iterated through and the 3D
pythagorean theorem performed to each tested point.