Exploring Different Ways to Index Entities and Components in an ECS Framework
ECS (Entity Component Framework) has gained a lot of popularity over the decade. It's very simple for people to understand and can be more intuitive than OOP for some people. However, getting ECS to perform well is more complex than at first glance. A simple design flaw can easily tank the performance of your ECS application.
One key design decision is choosing how your entities and components are indexed. This one decision is a serious cross-cutting concern as it affects many other aspects of your application, from how your entities and components are generated and deleted to how you prevent race conditions in a set of concurrently running systems.
In this paper, we will be exploring the various different methods Entities and Components are indexed and their performance characteristics. We will test them in different scenarios and demonstrate that there isn't a "One-Size-Fits-All" solution.