From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel 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 Message-ID: <9718A5AD-7A74-470B-A32D-DA14266506A3@raeburn.org> References: <4C018D79.7040409@censorshipresearch.org> <4C018FD3.1020305@censorshipresearch.org> <4C01AA28.6030002@censorshipresearch.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1275180359 13655 80.91.229.12 (30 May 2010 00:45:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 30 May 2010 00:45:59 +0000 (UTC) Cc: Emacs development discussions To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 30 02:45:58 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OIWf8-0001em-4O for ged-emacs-devel@m.gmane.org; Sun, 30 May 2010 02:45:58 +0200 Original-Received: from localhost ([127.0.0.1]:50545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIWf6-0006cb-Tz for ged-emacs-devel@m.gmane.org; Sat, 29 May 2010 20:45:56 -0400 Original-Received: from [140.186.70.92] (port=41125 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIWey-0006Yd-KP for emacs-devel@gnu.org; Sat, 29 May 2010 20:45:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIWex-0001Wl-2J for emacs-devel@gnu.org; Sat, 29 May 2010 20:45:48 -0400 Original-Received: from splat.raeburn.org ([69.25.196.39]:49327 helo=raeburn.org) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIWep-0001UW-Ai for emacs-devel@gnu.org; Sat, 29 May 2010 20:45:47 -0400 Original-Received: from squish.raeburn.org (squish.raeburn.org [10.0.0.172]) by raeburn.org (8.14.3/8.14.1) with ESMTP id o4U0jSlH027167; Sat, 29 May 2010 20:45:28 -0400 (EDT) In-Reply-To: <4C01AA28.6030002@censorshipresearch.org> X-Mailer: Apple Mail (2.1078) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:125353 Archived-At: 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=