bugKawa - Bugs: bug #16723, flattened serialization of lists


bug #16723: flattened serialization of lists

Submitted by:  tk <huh>
Submitted on:  Thu 01 Jun 2006 04:54:37 PM UTC  
Category: NoneSeverity: 3 - Normal
Item Group: Feature RequestStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Thu 01 Jun 2006 08:13:56 PM UTC, comment #2:

Fair enough, those are sound objections. While it was sufficient for my application, I'd agree that it doesn't serve well as a general approach (it certainly doesn't handle sharing, which I was willing to forfeit to avoid arbitrary overflow exceptions in cases where I don't control the use of list structures).

I like the idea of abstracting Pair.

tk <huh>
Thu 01 Jun 2006 06:29:00 PM UTC, comment #1:

I'm not really thrilled with this.
First and most critically, whatever we do here must continute to work with the Kawa literals framework (gnu.expr.LitTable). See:
This is not insurmountable; worst case we could special-case the handling of pair literals.
Second, I don't care for allocating a ProperListWrapper object in the middle of serialization: I don't think it's necessary, at least if we're willing to give up serialization compatibility.
Third, it appears this approach doesn't handle sharing. It would be a shame to lose that.

Now I am thinking about turning Pair into a more abstract class, with car/cdr as virual methods. So we could perhaps define a custom subclass of Pair that would be serialized differently. I don't know if that would work. Or as part of the serialization process you could convert to list to a vector (presumably much more compact) and back again.

But perhaps in that case a vector or extendable vector type would make more sense? (I think lists are way over-used.)

Per Bothner <bothner>
Project Administrator
Thu 01 Jun 2006 04:54:37 PM UTC, original submission:

java serialization overflows the stack on lists of more than a few hundred elements. this patch to gnu.lists.Pair provides a wrapper class for proper lists that uses iteration to serialize the list (the serialized data is also smaller since it doesn't store every cons cell).

tk <huh>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #10101:  pair.diff added by huh (2KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.


Please enter the title of George Orwell's famous dystopian book (it's a date):



Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Thu 01 Jun 2006 04:54:37 PM UTChuhAttached File-=>Added pair.diff, #10101

Back to the top

Powered by Savane 3.1-cleanup1