emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] use tail pointer for LOOP (Was: Re: O(N^2) behavior in LOOP)


From: Ken Raeburn
Subject: Re: [PATCH] use tail pointer for LOOP (Was: Re: O(N^2) behavior in LOOP)
Date: Sat, 29 May 2010 20:45:28 -0400

On May 29, 2010, at 19:58, Daniel Colascione wrote:
> We do this only for the anonymous-variable case, but it's still an
> improvement.

If it's only in the anonymous case, where (if I understand correctly) the value 
isn't accessible until the loop construct returns a value, why not keep it 
simple and build the list in reverse, doing an nreverse call at the end?  It 
doesn't need to be "in order" in the intermediate states.  Is it any faster to 
build the list in order?  (Simply avoiding nreverse obviously makes things a 
little faster, but are you doing more work each time around the loop to 
maintain and use the tail pointer?)

Ken


reply via email to

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