pointlight explosion - shader regeneration

When I create a PointLight for my explosions, the game hangs for a second or two, I’m guessing shader needs to be regenerated. Is there a workaround for this?

I don’t know what the proper solution is, I’m afraid, but one thought that comes to mind is keeping a set of lights aside for explosions and simply placing them and turning them on, then off after the appropriate time instead of creating new lights for each explosion.

I don’t know whether it will likely work, but if no better answers are given it might be worth trying.

Lights only have effect when you assign them to NodePaths, so you can have thousands of them technically if they are not enabled.
So since they don’t affect the nodes untill assigned, they have no visual impact, so shaders aren’t regenerated.
So that won’t work.