From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matthias Koeppe Newsgroups: gmane.lisp.guile.devel Subject: Re: [Patch] Re-implement srfi-1 partition in C to avoid stack overflow Date: Thu, 10 Jul 2003 15:59:26 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87isqbqorh.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1057848098 19323 80.91.224.249 (10 Jul 2003 14:41:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 10 Jul 2003 14:41:38 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jul 10 16:41:35 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19acc2-000512-00 for ; Thu, 10 Jul 2003 16:41:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19acZ5-0004rI-JN for guile-devel@m.gmane.org; Thu, 10 Jul 2003 10:38:31 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19acY6-0003vv-1k for guile-devel@gnu.org; Thu, 10 Jul 2003 10:37:30 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19acXj-0003iN-7V for guile-devel@gnu.org; Thu, 10 Jul 2003 10:37:07 -0400 Original-Received: from merkur.math.uni-magdeburg.de ([141.44.75.40]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19abxI-0003qh-H1 for guile-devel@gnu.org; Thu, 10 Jul 2003 09:59:28 -0400 Original-Received: from lambda ([141.44.75.79] helo=lambda.math.uni-magdeburg.de) by merkur.math.uni-magdeburg.de with esmtp (Exim 4.10) id 19abxH-0005hh-00 for guile-devel@gnu.org; Thu, 10 Jul 2003 15:59:27 +0200 Original-Received: (from mkoeppe@localhost) by lambda.math.uni-magdeburg.de (8.11.6+Sun/8.10.2) id h6ADxQA07050; Thu, 10 Jul 2003 15:59:26 +0200 (MEST) X-Authentication-Warning: lambda.math.uni-magdeburg.de: mkoeppe set sender to mkoeppe@mail.math.uni-magdeburg.de using -f Original-To: guile-devel@gnu.org In-Reply-To: <87isqbqorh.fsf@zip.com.au> (Kevin Ryde's message of "Thu, 10 Jul 2003 09:11:30 +1000") Original-Lines: 27 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.3.50 (sparc-sun-solaris2.8) X-Warning: no 'abuse'-account in domain mail.math.uni-magdeburg.de (cf. RFC2142/4.) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2616 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2616 Kevin Ryde writes: > Matthias Koeppe writes: >> >> + /* In this implementation, the output lists don't share memory with >> + list, because it's probably not worth the effort. */ > > It might be nice to share everywhere it's permitted, if you could be > bothered. (The non-tail recursion you're fixing is clearly the worst > problem though.) I decided against implementing the sharing of structure because: 1) It has a performance penalty because parts of the list need to be traversed twice. 2) The savings by the sharing of structure are "unpredictable", as it depends on the order of the input elements. There could only be savings if there is a long list tail of elements that go into one of the output lists, which I think is an "unlikely" case. On the other hand, it would be worthwhile to implement partition! so that it re-uses the cons cells of the input list. However, I don't have time to work on it. --=20 Matthias K=F6ppe -- http://www.math.uni-magdeburg.de/~mkoeppe _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel