ArtemisD: A D port of Artemis Entity System Framework for games.

Elvis Zhou elvis.x.zhou at gmail.com
Fri Oct 11 20:46:42 PDT 2013


On Friday, 11 October 2013 at 19:29:52 UTC, Agustin wrote:
> Correct me if i'm wrong, but isn't the whole point of Artemis 
> design to take advantage of CPU cache levels by storing every 
> component of the same type contignously?
>
> In your example, the components are stored non contignous, 
> using the GC
>
>     Entity e = world.createEntity();
>     e.addComponent(new Position(0,0));
>     e.addComponent(new Velocity(10,0));
>     e.addToWorld();
>
> I think a good optimization will be implementing a non GC 
> vector class to store every component contignous, and changing 
> it to this
>
>     Entity e = world.createEntity();
>     e.addComponent!Position(0, 0); // Forwarding. Just like 
> emplace for C++
>     e.addComponent!Velocity(10, 0); // Forwarding.
>     e.addToWorld();
>
> Position and Velocity are stored in an object pool vector that 
> will take advantage of the CPU cache when iterating.

Thank you, I'm going to improve ArtemisD with more D idioms and 
generic after this very first and straightforward port.


More information about the Digitalmars-d-announce mailing list