Closed
Description
Arrays of components in a ComponentArray
unpack pretty slowly because they allocate. Something like this:
boid = ComponentArray(pos=zeros(2), vel=zeros(2))
boid_box = ComponentArray(pos=zeros(2), vel=zeros(2), θ=0, ω=0)
u0 = ComponentArray(boid_box=boid_box, boids=repeat([boid], 100))
Right now, doing u0.boids
would allocate and be too expensive to use.
Maybe the right answer is StaticArrays. They wouldn't be able to be used for very large arrays of components, but it would at least it would make them useful for some problems.
Metadata
Metadata
Assignees
Labels
No labels