Open remexre opened 1 year ago
What does "ECS-style" mean?
Is the goal of this to reduce memory usage? Or performance?
Performance; improved cache locality, mainly.
ECS is a style of OO some games / game engines do as a library, where objects are just int
(-sized struct)s (Entities), you store arrays (or some other sparser data structure) of their fields (Components), and you perform computations over them as "for every entity with non-null values for components A, B, and C," which are easy to parallelize and have nice cache usage (Systems).
Putting this here as a note -- this is an experiment I wanna try after the deadline.
Instead of storing an array of attributes per-node, we could assign each node an
int
ID (unique perTopNode
, "densely assigned") and give it a pointer to theTopNode
, then store aHashMap<AttributeId, Object[]>
on theTopNode
, where the indices in the arrays are the node IDs.This feels like it oughta be a quick enough change to try out in a week or so.