Best data structure for a particle system?

Mikko Ronkainen mikoro at iki.fi
Fri Nov 15 04:19:40 PST 2013


> Use just one list with a flag in the particle to see whether the
> particle is alive or dead, saves swapping between lists and you
> can use a simple array for fast access.

Yes, simplicity, that's a good idea :) I was just wondering how 
much time would be saved if just iterating over the active 
particles instead of everything every time (say a system of 10000 
particles). Maybe that's relevant, maybe not.

If relevant, doubly-linked might work better? dcollections 
LinkList, or maybe DList? I'm asking mostly because I'd like the 
container to avoid memory allocations while in use.


More information about the Digitalmars-d-learn mailing list