I just started a rather ambitious economy simulation project where I have to loop a lot through various arrays/structs, some of them with constant values. When looking for a way to optimize perfomance right from the start, I stumbled upon loop unrolling:
I would not consider loop unrolling until you have a finished version of the script. Stuff like loop unrolling is so low-level, that you should never do it manually. Not until you have exhausted every other algorithmic improvement possible and profiling indicates that that specific loop is a the bottleneck or a big part of it.
And after you tried optimizing code at such a low level do another performance test to see if what you changed actually improved things.
Reasons for this are that undoing loop unrolling is harder than unrolling a loop, the overhead of loops is minimal at best, so only the tiniest loop bodies are worth unrolling, and you might be focusing on these micro-optimizations before actually having exhausted algorithmic improvements, which usually provide far better benefits.
You are better off using Amdahl's law when trying to optimize your code. Find the biggest bottleneck, and improve that. This will have the biggest effect on your performance. So pretty much what Deaod said because most of the time it's your algorithms. The galaxy compiler also probably automatically unrolls your loops because modern compilers do it behind the scene.
Also consistent readable code is by far better than unreadable code. Less room for bugs, which means less development time. (Unless you are making some sort of standard library, which is not the Starcraft2 mod scene)
Of course loop unrolling will screw readability and there are more obvious methods to improve performance, but I simply wanted a second opinion on that. As the map will be SP only (at least for the prototype), maybe there won't be any performance issues after all.