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 <
[email protected]>:

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

Reply via email to