|
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:
Hello! (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 apity as it inhibits tail-call optimization;Indeed, a pity. Though self-tail calls can be optimized... still, irritating.
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?
Ken
[Prev in Thread] | Current Thread | [Next in Thread] |