Perhaps updating the lights' paths less frequently and turning lights that are invisible or too far away off? What I mean by updating lights' paths less frequently is to have 8 lights to be processed in one frame, the next 8 lights processed in the next frame, then the final 8 in the third frame. After that, update the first 8 lights in the fourth frame, update the next 8 in the fifth, the next 8 in the sixth then update the first 8 again in the seventh and so on. Though I'm not sure how to script it, perhaps using a while loop for processing lights and when 8 lights are done, insert a wait instruction then the next 8 lights follow with another wait instruction like this in a way:
while(1)
{
light_1_action;
light_2_action;
light_3_action;
light_4_action;
light_5_action;
light_6_action;
light_7_action;
light_8_action;
wait(1);
light_9_action;
light_10_action;
light_11_action;
light_12_action;
light_13_action;
light_14_action;
light_15_action;
light_16_action;
wait(1);
light_17_action;
light_18_action;
...
wait(1);
}
Don't know if this'll work, but you can certainly try it. This idea is only best at slow speeds, but if you have too many lights, you'll need a longer delay and it'll soon become noticeable, especially at low frame rates.