unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>
Subject: Re: [Patch] Re-implement srfi-1 partition in C to avoid stack overflow
Date: Thu, 10 Jul 2003 15:59:26 +0200	[thread overview]
Message-ID: <uw5ptkitrcx.fsf@lambda.math.uni-magdeburg.de> (raw)
In-Reply-To: <87isqbqorh.fsf@zip.com.au> (Kevin Ryde's message of "Thu, 10 Jul 2003 09:11:30 +1000")

Kevin Ryde <user42@zip.com.au> writes:

> Matthias Koeppe <mkoeppe@merkur.math.uni-magdeburg.de> 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.

-- 
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2003-07-10 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-19 15:58 [Patch] Re-implement srfi-1 partition in C to avoid stack overflow Matthias Koeppe
2003-07-09 23:11 ` Kevin Ryde
2003-07-10 13:59   ` Matthias Koeppe [this message]
2003-07-13 23:06 ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uw5ptkitrcx.fsf@lambda.math.uni-magdeburg.de \
    --to=mkoeppe@mail.math.uni-magdeburg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).