D looses in speed to Common Lisp

maarten van damme via Digitalmars-d digitalmars-d at puremagic.com
Mon May 11 14:37:00 PDT 2015


It may be a good idea to prealocate the whole array so you don't resize the
dynamic arrays every execution of the loop.

2015-05-11 23:30 GMT+02:00 weaselcat via Digitalmars-d <
digitalmars-d at puremagic.com>:

> On Monday, 11 May 2015 at 21:15:33 UTC, Dzhon Smit wrote:
>
>> ...
>>
>
> time sbcl --dynamic-space-size 4GB --script fib.lisp
> 0
> 1.16user 1.49system 0:02.67elapsed 99%CPU (0avgtext+0avgdata
> 1658860maxresident)k
>
> ldc -O5 -release -boundscheck=off fib.d
> $ time ./fib
> 0
> 1.33user 0.81system 0:02.15elapsed 99%CPU (0avgtext+0avgdata
> 1230712maxresident)k
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150511/2b5b16e6/attachment.html>


More information about the Digitalmars-d mailing list