SIMD instructions for OpenEcs
I've been thinking if entity iteration speed could be improved by using intels SIMD instructions. SIMD stands for Single Instruction Multiple Data and gives improved performance if tasks can be computed in parallel.
The compiler can use SIMD instructions if a loop can be "vectorized". If a loop is vectorized, it can basically do many loops in one. See more about SIMD here
Right now, entity iterations are not vectorized (I think) when using OpenEcs. Do you guys think this is doable in an ECS lib? The problem is that component data is not always after each other in memory (but sometimes they are). I'm not sure how to apply SIMD instructions for OpenEcs, or even if its possible, but it's worth looking into.
This would greatly improve the performance, I'm curious, you'll implement this?
I would like to, but I'm not sure how it can be done. OpenEcs provides an abstraction layer that might cause the the compiler to miss optimisations such as SIMD instructions. I would have to look into the subject more in order to understand how it can be done. Though it is not highly prioritized right now. I would welcome any help/discussions/insights in the subject though.