emacs-devel
[Top][All Lists]
Advanced

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

Re: In support of guile-emacs


From: Alan Mackenzie
Subject: Re: In support of guile-emacs
Date: Wed, 21 Oct 2015 13:13:53 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

Hello, Taylan.

On Wed, Oct 21, 2015 at 02:54:15PM +0200, Taylan Ulrich Bayırlı/Kammer wrote:
> address@hidden (Taylan Ulrich "Bayırlı/Kammer") writes:

> > Alan Mackenzie <address@hidden> 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).



reply via email to

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