Fastest filtered scanning of arraylist

The DOD idea in your case is the following: you have 2 arrays, the first with all the lemmings, the second [128]u8 with only the numbers of living lemmings. Every time you need to update the living lemmings, you simply iterate through your array of living lemmings which is index linked to the actual array. This is much faster because you don’t have any if statements. These are the most time consuming because your processor causes cache misses.

for(living_lems) |i| {
   doSomething(lemmings[i]);
}