From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Ellis Newsgroups: gmane.lisp.guile.bugs Subject: Re: Loop optimization Date: Mon, 7 Mar 2011 18:10:33 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1299539463 16344 80.91.229.12 (7 Mar 2011 23:11:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Mar 2011 23:11:03 +0000 (UTC) Cc: Guile bug To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Mar 08 00:10:59 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PwjZo-0003bc-Aa for guile-bugs@m.gmane.org; Tue, 08 Mar 2011 00:10:56 +0100 Original-Received: from localhost ([127.0.0.1]:32807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwjZm-0006XQ-2E for guile-bugs@m.gmane.org; Mon, 07 Mar 2011 18:10:54 -0500 Original-Received: from [140.186.70.92] (port=33757 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwjZV-0006WI-D3 for bug-guile@gnu.org; Mon, 07 Mar 2011 18:10:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwjZT-0002oT-4I for bug-guile@gnu.org; Mon, 07 Mar 2011 18:10:36 -0500 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:56668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwjZS-0002oJ-Pt for bug-guile@gnu.org; Mon, 07 Mar 2011 18:10:35 -0500 Original-Received: by wyi11 with SMTP id 11so5439097wyi.0 for ; Mon, 07 Mar 2011 15:10:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=C7/kMKqbayIm4E3a1E4K2JD9vj/d1jmUWd19roqeNsg=; b=FvHCSs5SbX09lVncfPrDD6GZexYpADbnHXHKZo3HbI4jzVuXNiA3JzAVuvosjP3/Y/ QXN9S7NCupjqxk3mMENuBNIxMhR9kgXk5Cl+hkgrKekrSBBeb0J0FY0JDITTA+N6Dqae 7hKAM96itm2CLDZzbtPdsJih2c2kkoSd5oyeQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=xmU/fCEP1kvaQh1u+Jsrq4bZgPz0a4sdQcJ8EvV/IGIfWH7LV4H4dWF9zgdx/+qpvq tSTrvKdYDxtuHYsV/q8z7BveI/4UuklFtAXY8cN4ZtNsSmK5fF4pARzJ1yNQC+JHFIPF 2nRZ1e5Y4ZAzQz3h/1qHfxzk2LxHdfkI7BBUk= Original-Received: by 10.227.104.2 with SMTP id m2mr4040704wbo.35.1299539433942; Mon, 07 Mar 2011 15:10:33 -0800 (PST) Original-Received: by 10.227.144.207 with HTTP; Mon, 7 Mar 2011 15:10:33 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.169 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5308 Archived-At: 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): pass print i real 0m0.641s user 0m0.625s sys 0m0.012s (let loop ((i 0)) (if (<=3D 10000000 i) (begin (display i) (newline)) (loop (1+ i)))) real 0m0.495s user 0m0.465s sys 0m0.010s Cheers, Mike On Mon, Mar 7, 2011 at 4:36 PM, Andy Wingo wrote: > =A0(let loop ((i 0)) > =A0 =A0(if (<=3D 10000000 i) > =A0 =A0 =A0 =A0(begin (display i) (newline)) > =A0 =A0 =A0 =A0(loop (1+ i))))