[Top][All Lists]

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

Re: Elisp performance

From: Ken Raeburn
Subject: Re: Elisp performance
Date: Tue, 4 Aug 2009 11:58:56 -0400

On Aug 4, 2009, at 06:17, Andy Wingo wrote:

(Was away for the weekend, but back hacking all week now.)

Welcome back!

On Thu 30 Jul 2009 22:18, Neil Jerram <address@hidden> writes:
Daniel Kraft <address@hidden> writes:

Lambda arguments are still always dynamically bound, which is quite a
pity as it inhibits tail-call optimization;
Indeed, a pity. Though self-tail calls can be optimized... still,

In the compiler, or in the byte-code engine?

The Emacs byte compiler does not do self-tail call optimizations. Since the function value of a symbol can be copied out and/or replaced (and Emacs ships with the "advice" package which does both), the symbol's function value may wind up not being the function body being compiled; turning a self-tail call into a jump back to the beginning would cause observable behavior changes from what happens now.

On the other hand, I haven't looked at what elisp compiles to in Guile; maybe it's possible to have the byte-code engine detect when you're making a tail call to yourself (such as recursive calls when the function value slot hasn't been messed with) and optimize them on the fly?


reply via email to

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