[Top][All Lists]

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

Execution speed

From: Stefan Monnier
Subject: Execution speed
Date: Sun, 19 Mar 2017 11:12:59 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Someone on SO reported a surprising behavior where a recursive
implementation of `gcd` turned out faster than the iterative version:


The more surprising thing is that when I try it I get the
opposite result, even though it's basically on the same kind of system
(GNU/Linx x86).

I'm curious where the difference might come from.  Could you guys try
out the test?

Just do `emacs -Q --batch -l .../ir-test.el`.  Here's what I got:

    % emacs24 -Q --batch -l ~/tmp/ir-test.el
    Interpreted:  Iterative=1.770s; Recursive=1.937s
    Bytecompiled: Iterative=1.187s; Recursive=1.496s
    % .../src/emacs -Q --batch -l ~/tmp/ir-test.el
    Interpreted:  Iterative=4.496s; Recursive=4.595s
    Bytecompiled: Iterative=2.471s; Recursive=2.983s

where `emacs24` is Debian's whereas the other one is my locally
built&hacked version with debugging assertions and stuff.


Attachment: ir-test.el
Description: application/emacs-lisp

reply via email to

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