Can fat ECS still give good performance?

OK ECS is designed to use minimum data sets to boost performance, but could you still get good performance with fatter and more complex ECS.

So instead of writing lots of systems for every action you write fewer systems that can process a few different actions.

Or has anyone benchmarked ECS to see what data and processing loads it can handle for maximum throughput?

A good example would be using an FSM or Behavioural Tree to trigger different actions so would need more data to directly process the actions or pass onto subsystems to run the actions.

ECS systems update method runs on main thread. The idea of having multiples systems is to have the logic separated. If you have a huge system that can’t be split in many smaller systems, there is no problem at all, since you can do many works inside a single update and still get good performance using Job Systems.

But try to split whenever you can, so you get a modular system that you can test, upgrade, debug and reuse them.

1 Like

if you are to make it too “fat” and all functionality of something is in one system, then you are trying OOP in ECS. You will still get some more performance but I dont see why. It just feels that you will end up with OOP spaghetti code in the end

In theory as long as the ECS data footprint is under the L1 cache size then you should get good performance the question is what is the maximum data size vs the amount of processing before performance is impacted?

Modern CPU’s like…

  • Intels Kaby Lake have 32 Kb for Data and 32 Kb for instructions.
  • AMD Zen have 32 Kb for Data and 64 Kb for instructions.

So I’m guessing you need to keep your data under 32 Kb or for it to even work performantly and then if you factor in the L1 to L2 cache size and performance and the L2 to L3 and L3 to Ram these aspects of your CPU will effect the total processing load your system can handle well.

Also you will need to keep your processing instructions under 32 kb or 64 kb if your running on a Kabylake or Ryzen CPU.

And this information will vary for every CPU you target your game to, so what is a good maximum size for ECS data and overall job sizes or number of jobs?