D looses in speed to Common Lisp
anonymous via Digitalmars-d
digitalmars-d at puremagic.com
Mon May 11 15:22:22 PDT 2015
On Monday, 11 May 2015 at 21:15:33 UTC, Dzhon Smit wrote:
> Tests on my machine:
> [code]$ time ./fib
> 0
>
> real 0m6.458s
> user 0m2.250s
> sys 0m0.933s
> $ time sbcl --dynamic-space-size 4GB --script fib.lisp
> 0
>
> real 0m1.884s
> user 0m1.290s
> sys 0m0.260s[/code]
Can't confirm that. Times for me (linux x86_64):
----
$ dmd fib.d && time ./fib
0
real 0m2.410s
user 0m1.844s
sys 0m0.558s
$ time sbcl --dynamic-space-size 4GB --script fib.lisp
0
real 0m2.659s
user 0m2.144s
sys 0m0.506s
----
As usual, ldc produces a faster binary than dmd:
----
$ ldc2 fib.d && time ./fib
0
real 0m1.900s
user 0m1.396s
sys 0m0.499s
----
Optimization flags don't seem to matter much for this program.
More information about the Digitalmars-d
mailing list