OpenEcs icon indicating copy to clipboard operation
OpenEcs copied to clipboard

SIMD instructions for OpenEcs

Open Gronis opened this issue 10 years ago • 2 comments

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.

Gronis avatar Dec 06 '15 22:12 Gronis

This would greatly improve the performance, I'm curious, you'll implement this?

ghost avatar Apr 27 '16 15:04 ghost

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.

Gronis avatar Apr 27 '16 19:04 Gronis