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

 
 

bug #16723: flattened serialization of lists

Submitter:  tk <huh>
Submitted:  Thu 01 Jun 2006 04:54:37 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Feature Request Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

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:
http://www.gnu.org/software/kawa/internals/code-generation.html#literals
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>
Group 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 Files:
   
   
Comment:
   

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2006-06-01 huh Attached File- Added pair.diff, #10101

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code