A little benchmark in D and C

Jyxent via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Fri Jul 4 08:54:30 PDT 2014


On Friday, 4 July 2014 at 15:40:26 UTC, bearophile wrote:
> I compile with:
> ldmd2 -O -release -inline -noboundscheck test1.d
> gcc -O3 -std=c99 test2.c -o test2
>
> I use gcc 4.8.0.
>
> On an old PC the run-time of C version is about 5.2 seconds, 
> while the D version compiled with the latest ldc2 runs in about 
> 26 seconds (almost 5 times slower).

I repeated your test with ldc2, clang, and gcc.  The D and C 
programs both run in about 16 seconds when compiled with ldc2 and 
clang on my machine.  The gcc compiled C program ran in about 1.5 
seconds.  So probably something LLVM specific?


More information about the digitalmars-d-ldc mailing list