Performance problem in reverse algorithm

Fool via digitalmars-d-ldc digitalmars-d-ldc at
Mon Aug 25 11:04:01 PDT 2014

Hi Kai!

On Monday, 25 August 2014 at 16:49:34 UTC, Kai Nacke wrote:
> On Sunday, 24 August 2014 at 16:45:12 UTC, Fool wrote:
> The speed of binaries produced by ldc is roughly the same as of 
> binaries from clang++. That is no wonder as both use the same 
> LLVM machinery.

Yes, that's what I thought. Probably, there is something strange 
going on in the depths of LLVM.

> You could try the LDC_never_inline pragma 
> (
> Unfortunately, general attributes are not yet implemented in 
> LDC (see issue #561, 

Introducing pragma(LDC_never_inline) slightly improves execution 
time of the ldc result to 5.4s. Still, this is more than three 
times slower than the fast version produced by clang++.

> That is an instance of issue #683, 
> Sorry for 
> that.

No problem, thanks for the info!

> I will try to check this but it will take some time as I am 
> busy with some other D related tasks.

Thanks, there is no time pressure. I compared ASM and LLVM-IR of 
the fast and slow versions using clang++. Unfortunately, my foo 
in this area is non-existent. The only thing I noticed is that 
the fast version has significantly longer ASM and LLVM-I 

Kind regards,

More information about the digitalmars-d-ldc mailing list