I am making a libGDX (Android) game for which I'll have 90 ParticleEffects playing simultaneously. These may however be of about 25 different types (e.g.: water, fire, ...), which would potentially mean that 2250 effects are pooled in 25 different pools. I estimate that I need about 20 new effects per second.
Now I have 3 possibilities to implement this:
- Pooling, with a potential size of 2250, while I only need to show 90 at a time. --> memory overhead
- Keep a list of 90 effects and dispose() / create() them at a frequency of 20 times per second. --> computationally expensive
- Pooling, but now dispose() effects which probably are not needed in the next ~10 seconds, which would require them to be recreated once they are needed. This way, the size would reduce to about 300-500. --> less memory overhead than (1), but potentially the same computational requirement as (2) at times.
Q: Is there any way to say which possibility is the `better' option in terms of lowest computational cost / memory overhead? Which is equivalent to asking: How efficient is pooling ParticleEffects?
Thanks in advance.