From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: In support of guile-emacs Date: Wed, 21 Oct 2015 13:13:53 +0000 Message-ID: <20151021131353.GD2608@acm.fritz.box> References: <5624FADF.9070908@dancol.org> <20151019143527.GG2438@acm.fritz.box> <87eggqn6eo.fsf@T420.taylan> <20151019171909.GH2438@acm.fritz.box> <87wpuilml3.fsf@T420.taylan> <20151019201224.GJ2438@acm.fritz.box> <87h9lmlgim.fsf@T420.taylan> <20151020095332.GA1781@acm.fritz.box> <87bnbtgv3p.fsf@T420.taylan> <878u6wfklk.fsf@T420.taylan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1445433647 25153 80.91.229.3 (21 Oct 2015 13:20:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Oct 2015 13:20:47 +0000 (UTC) Cc: Xue Fuqiao , Christopher Allan Webber , Daniel Colascione , bruce.connor.am@gmail.com, emacs-devel To: Taylan Ulrich =?utf-8?B?QmF5xLFybMSxL0thbW1lcg==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 21 15:20:38 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZotJi-000224-Vu for ged-emacs-devel@m.gmane.org; Wed, 21 Oct 2015 15:20:35 +0200 Original-Received: from localhost ([::1]:51533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZotJh-0003jy-KC for ged-emacs-devel@m.gmane.org; Wed, 21 Oct 2015 09:20:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZotBl-00007X-Jt for emacs-devel@gnu.org; Wed, 21 Oct 2015 09:12:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZotBh-0005zK-GR for emacs-devel@gnu.org; Wed, 21 Oct 2015 09:12:21 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:44266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZotBh-0005y9-57 for emacs-devel@gnu.org; Wed, 21 Oct 2015 09:12:17 -0400 Original-Received: (qmail 83905 invoked by uid 3782); 21 Oct 2015 13:12:14 -0000 Original-Received: from acm.muc.de (p548A5439.dip0.t-ipconnect.de [84.138.84.57]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 21 Oct 2015 15:12:13 +0200 Original-Received: (qmail 18536 invoked by uid 1000); 21 Oct 2015 13:13:53 -0000 Content-Disposition: inline In-Reply-To: <878u6wfklk.fsf@T420.taylan> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192277 Archived-At: Hello, Taylan. On Wed, Oct 21, 2015 at 02:54:15PM +0200, Taylan Ulrich Bayırlı/Kammer wrote: > taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes: > > Alan Mackenzie writes: > >> [...] > >>> (let loop ((i 0) (s 0)) > >>> (if (<= i 10000000) > >>> (loop (+ i 1) (+ s i)) > >>> (format #t "~s" s))) > >>> Takes about 0.50s. > >> So, we're talking about a speed up of around 13%/25% on a simple loop > >> test, depending on whether or not an idiomatic Scheme formulation is > >> used. Given that Guile compiled elisp wouldn't be optimised in this way, > >> it would guess that the 13% is nearer the mark. But it would take a few > >> real life tests to measure this better. > > Indeed, I don't think any conclusions should be drawn from this. > While we still shouldn't draw any conclusions, I've repeated the test > with master branch Guile now, since it's apparently packaged for Guile > (as "guile-next") and thus trivial to install... > The idiomatic Scheme version: > (let loop ((i 0) (s 0)) > (if (<= i 10000000) > (loop (+ i 1) (+ s i)) > (format #t "~s" s))) > ~0.27s > The Elisp-transcribed-to-Guile version: > (let ((i 0) (s 0)) > (while (<= i 10000000) > (set! s (+ s i)) > (set! i (1+ i))) > (format #t "~s" s)) > ~0.36s > So the idiomatic version provides a ~2.3x speedup, and the literal > transcription ~1.7x. I'm not sure what exact percent notation you used, > but if it's (x - y) / y * 100 for original time x and new time y, then > these are 130% and 70% which sounds pretty great! I think I used ((slow time) / (fast time) - 1) * 100, which is probably an equivalent formula. But, what the heck? I'm impressed. A factor of 2.3, or 1.7 speedup in elisp would be very worthwhile, IMAO. > I'd also like to point out that this means the switch from Guile 2.0 to > 2.2 (master) entails a 50% speedup of the Elisp-transcribed version (and > a 85% speedup of the idiomatic Scheme version). This is *still* a silly > loop test, but nevertheless, those are impressive numbers, which I think > gives me a bit of defensibility in what I had said optimistically with > regard to Guile performance having a bright future. :-) Go for it! > Taylan -- Alan Mackenzie (Nuremberg, Germany).