Awesome post , really appreciate that you give the time to share your knowledge.
I’m very clear on the caching thing now. Mostly I’d overlooked the fact that it’s a two dimensional problem (missiles and targets), so you can obviously get a huge gain by doing only O(M+N) work involving dereferences, then O(M*N) on a cache-friendly data structure. But your explanation has me convinced that it could be beneficial even in a one dimensional scenario. Interesting about the ‘context switching’ too - I don’t have the experience to know, but had wondered if that might be a problem.