[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loop optimization

From: Michael Ellis
Subject: Re: Loop optimization
Date: Mon, 7 Mar 2011 18:10:33 -0500

Thanks for the education, Andy, and congrats again on the guile
compiler implementation.  Your version handily outperforms the fastest
python implementation I know.

for i in xrange (10000000):
print i

real    0m0.641s
user    0m0.625s
sys     0m0.012s

(let loop ((i 0))
   (if (<= 10000000 i)
       (begin (display i) (newline))
       (loop (1+ i))))

real    0m0.495s
user    0m0.465s
sys     0m0.010s


On Mon, Mar 7, 2011 at 4:36 PM, Andy Wingo <address@hidden> wrote:
>  (let loop ((i 0))
>    (if (<= 10000000 i)
>        (begin (display i) (newline))
>        (loop (1+ i))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]