On Oct 29, 2013 7:36 AM, "Iain Buclaw" <ibuclaw@ubuntu.com> wrote:
>
>
> On Oct 29, 2013 7:16 AM, "Joseph Rushton Wakeling" <joseph.wakeling@webdrake.net> wrote:
> >
> > On 28/10/13 20:02, Iain Buclaw wrote:
> >>
> >> I don't see it that way.  Up until now at least I haven't seen
> >> anything they do that wasn't already do-able in GCC.
> >
> >
> > I confess I may be biased here because recently I've been finding that D code compiled with LDC seems to typically run faster than stuff compiled with GDC -- particularly code which makes any kind of serious use of stuff from std.algorithm or any other strongly generic parts of the language.
> >
> > I can't imagine there are any fundamental frontend glue-code differences that are responsible for that, so I was assuming LLVM had a few areas where its optimizations worked better than the GCC middle/backend for various language constructs.
> >
> > I did test just now making sure that I used GDC with -march=native just in case that was the issue, but there's still a performance gap.  The only other guess I have -- and it's a complete guess -- could it be inline-assembly related, that LDC gains a little here?
>
> Inline assembler for dynamic array vector operations does improve speed by 20% over the generic loop that GDC uses (for small arrays at least).
>

Speaking of arrays, GDC up until recently allocated memory for every single [array, literal] in D code. This would give a noticeable slowdown in such code too.

Regards
--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';