• 0

    posted a message on Loop unrolling - perfomance advantage?

    Hey, thanks for the input!

    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.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Loop unrolling - perfomance advantage?

    Yeah, that's what I thought, too. And, God forbid, I would probably hit the script limit pretty soon :)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Loop unrolling - perfomance advantage?

    Hey,

    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:

    e.g.

    for ( i=0 ; i<8 ; i=i+1 )
        dest[i] = src[i];
    

    becomes

    dest[0] = src[0];
    dest[1] = src[1];
    dest[2] = src[2];
    dest[3] = src[3];
    dest[4] = src[4];
    dest[5] = src[5];
    dest[6] = src[6];
    dest[7] = src[7];
    

    The value assignments for my arrays are generated within an VBA automated excel sheet, so I can change values and generate new unrolled loops very fast.

    But I am curious, has anyone of you tested loop unrolling with Galaxy to find out if there is any relevant performance advantage? Or will the Galaxy compiler do this for me by itself?

    Posted in: Galaxy Scripting
  • To post a comment, please or register a new account.