From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.lisp.guile.devel Subject: Re: guile performance - Ackermann function: way slower than emacs, slower still if compiled Date: Tue, 4 Aug 2009 11:56:06 -0400 Message-ID: <8DCA1A3C-BE2A-4B05-9093-E137A0A2219E@raeburn.org> References: <4A783D0C.6000701@gentoo.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249401444 24174 80.91.229.12 (4 Aug 2009 15:57:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Aug 2009 15:57:24 +0000 (UTC) Cc: guile-devel To: Marijn Schouten (hkBst) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Aug 04 17:57:17 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MYMO4-0005xB-6x for guile-devel@m.gmane.org; Tue, 04 Aug 2009 17:57:16 +0200 Original-Received: from localhost ([127.0.0.1]:38860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYMO3-0005Bk-Ok for guile-devel@m.gmane.org; Tue, 04 Aug 2009 11:57:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYMNW-00051Q-2Q for guile-devel@gnu.org; Tue, 04 Aug 2009 11:56:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYMNR-0004zT-EJ for guile-devel@gnu.org; Tue, 04 Aug 2009 11:56:41 -0400 Original-Received: from [199.232.76.173] (port=42158 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYMNR-0004zP-3d for guile-devel@gnu.org; Tue, 04 Aug 2009 11:56:37 -0400 Original-Received: from splat.raeburn.org ([69.25.196.39]:45411 helo=raeburn.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MYMNH-0002nr-Hr for guile-devel@gnu.org; Tue, 04 Aug 2009 11:56:36 -0400 Original-Received: from [10.0.0.172] (squish.raeburn.org [10.0.0.172]) by raeburn.org (8.14.3/8.14.1) with ESMTP id n74Fu6xY023253; Tue, 4 Aug 2009 11:56:06 -0400 (EDT) In-Reply-To: <4A783D0C.6000701@gentoo.org> X-Mailer: Apple Mail (2.935.3) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9023 Archived-At: On Aug 4, 2009, at 09:52, Marijn Schouten (hkBst) wrote: > A more idiomatic way to implement it that also works in other > Schemes is: I know, shame on me for using "set!" in my code. :-) I was aiming for code very similar between Lisp and Scheme versions, so that (insert some hand-waving here) it might be more reasonable to compare Emacs and Guile performance; named loops wouldn't work for Lisp, tail-recursive functions don't get optimized into loops in Emacs Lisp, etc. So while loops with explicit setting of new values seemed like a good compromise. (Then again, like I said, I was aiming for something to exercise the GC system in particular, and failed there anyways.) It would've been better still if I'd pulled up the elisp branch and compared that against Emacs for processing the same Lisp code.... > On my machine larceny computes (A 3 9) in 83 ms and (A 4 1) in less > than 22 > seconds. In guile-1.8.6 this version is also twice as fast as your > version for > (A 3 9); they run 9s and 18s respectively. I haven't tried the new > guile > compiler yet. Thanks! The compiler geek in me wants to suggest that the compiler should be able to transform away most of the differences and the performance should be nearly the same. :-) (The compiler geek in me also knows better than to expect it.) For completeness, the timings I get for A(3,9) with your version, on the same machine I used before: 1.8.7: 8.4s 1.9.1, not compiled: 13.1s 1.9.1, compiled: 2.8s I also tried A(4,1) in the compiled version, and it took 13m20s. So the 1.9.1-compiled version of your code, from two data points, appears to be only a bit slower than the byte-compiled Emacs version. Ken