I managed to get some free time to look at this and it would appear that static foreach is slower than hand unrolling a loop. Fortunately there are no detectable differences between hand unrolling a loop and building the body of the loop in a compile time string and using a mixin. Results are here:

http://github.com/gcharnock/phoboslinalgebra/blob/4d1f62ce2f866acf24f237be77a2b59158571de0/staticloop_results.txt

Test program is here:

http://github.com/gcharnock/phoboslinalgebra/blob/4d1f62ce2f866acf24f237be77a2b59158571de0/staticloops.d

Reply via email to