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: Taylan Ulrich Bayırlı/Kammer
Subject: Re: In support of guile-emacs
Date: Wed, 21 Oct 2015 14:54:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

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'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. :-)

Taylan



reply via email to

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