libgdx / ashley

A Java entity system inspired by Ash & Artemis.
Apache License 2.0
875 stars 144 forks source link

how is the compent managed in memory? #291

Closed choxsword closed 4 years ago

choxsword commented 4 years ago

the reason ECS (entity component system) has great performance, like entitas in unity, is that components of same type are put in the same memory chunk, which make component iterating fast and efficient.

However, in java we cannot manage object memory location, so ecs seems to be not so useful as c++ in java language. Does ashley handled this problem?

dsaltares commented 4 years ago

Ashley is meant to be super simple and does not attempt to allocate contiguous memory blocks for components. Other Java ECS implementations are faster atm as well. However, Ashley is quite easy to use.

Hope this answers your question.