jankotek / elsa

Java serialization, faster and space efficient version of ObjectOutputStream
Apache License 2.0
45 stars 9 forks source link

Incremental serialization #9

Open jankotek opened 7 years ago

jankotek commented 7 years ago

From email at Kryo mailing list:

My use case would be a large-ish (several GB) in-memory state that needs to be saved periodically (every five minutes or so). No in-place updates, new state is generated from scratch (but a large amount of substructures are supposed to be shared with previous state).

So the object graph has new root on each update and data are immutable. Now it makes sense.

In theory it could be handled the same way as circular references. Serializer would save its state (IdentityHashMap) between updates. On next update serializer would just continue with original Map and replace objects from first version, with their pointers.

There are two problems: