<p dir="ltr">On 27 Oct 2015 9:15 pm, "David Nadlinger via Digitalmars-d" <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br>
><br>
> On Tuesday, 27 October 2015 at 18:19:38 UTC, Etienne Cimon wrote:<br>
>><br>
>> On Tuesday, 27 October 2015 at 18:18:36 UTC, Etienne Cimon wrote:<br>
>>><br>
>>> LDC couldn't inline it either. My only options at this point is to write the assembly or link to a C library.<br>
>><br>
>><br>
>> Btw, DMD and LDC had similar performance.<br>
><br>
><br>
> This would be very strange in numerical code. Are you building all the relevant modules at once, and with `ldc2 -singleobj` or `ldmd` (which enables -singleobj by default)? LDC will not do cross-module inlining otherwise.<br>
><br>
>  — David</p>
<p dir="ltr">There was a recent talk on optimisations using a sumMatrix function and about 9 variants of it.  Unfortunately the graphs of LDC didn't fit the screen, but the speaker assured there was nothing interesting to see (for the most part, the half graphs of LDC only started to look more performant than DMD when vectors started being used).</p>
<p dir="ltr">Ignoring the vector implementations, it was found that DMD did best when the loop was hand unrolled, and GDC outperformed the vectorized versions (and all other compilers) by using an obscure one-liner combination of std.algorithm functions with unsafe math optimisations turned on.</p>
<p dir="ltr">std.algorithm.sum was the slowest of the bunch.</p>
<p dir="ltr">I'll have to see if anything was published.</p>
<p dir="ltr">Iain.</p>