Should I do ParticleSystem pooling, and how to do better?

I implemented a Component for pooling UParticleSystemComponent, it’s mainly used for improving performance of chain explosions or other situation that the same effect plays on top of each other.

While sometimes it does improve the performance quite a bit, sometimes seems to have no impact, especially running in higher resolutions (around 1080p).

Later I read this article, in which Rama mentioned

it’s probably best to let UE4 handle particle memory management, as a system is already fullly in place for you thanks to our lovely friends at Epic

I wonder if doing pooling would help at all, if so, how should I change the way I pool in order to get better performance?

The implementation is simple

  • Having a TLinkedList AvailableParticleSystem contains pointers of available UParticleSystemComponent
  • Having a TArray AllParticleSystem contains pointers of all UParticleSystemComponent
  • When a new UParticleSystemComponent is created, add it into AllParticleSystem, and bind event to OnSystemFinished and OnComponentDeactivated so we know when it’s free later on
  • When a UParticleSystemComponent is free, add it to AvailableParticleSystem

(new TLinkedList<UParticleSystemComponent*>(theParticleSystemComponent))->LinkHead(AvailableParticleSystem);

  • When using UParticleSystemComponent, get it from AvailableParticleSystem

TLinkedList<UParticleSystemComponent*> *ptr = AvailableParticleSystem;
if(ptr)
{
	(*ptr).Unlink();
	UParticleSystemComponent* psc = *(*Nodeptr);
	return *(*Nodeptr);
}

  • Create new UParticleSystemComponent only when there’s no vailable in AvailableParticleSystem.

Thank!