Hacker News new | ask | show | jobs
by nasretdinov 8 days ago
Ideally you'd want to go further and actually store the is_alive as a bit mask and use SIMD instructions to filter out zeroes for example.
1 comments

Even without SIMD (not counting SWIR as SIMD) if you knew most entities were alive, you could zoom through the array checking 64 at a time until you found one that wasn't all 1s and then inspect more closely. Though maybe an index list is better if they're almost all alive.