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).

LLVM certainly is making a name for itself in specialist benchmarks.  I'm not sure how well it fares in general usage cases...

Regards
--
Iain Buclaw

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