I must serialize a huge tree of objects (7,000) into disk. Originally we kept this tree in a database with Kodo, but it would make thousands upon thousands of Queries to load t
For performance, I'd suggest not using java.io serialisation at all. Instead get down on to the bytes yourself.
If you are going to java.io serialise the tree you might need to make sure your recursion doesn't get too deep, either by flattening (as say TreeSet
does) or arranging to serialise the deepest nodes first (so you have back references rather than nested readObject
calls).
I would be surprised if there wasn't a way in Kodo to read the entire tree in in one (or a few) goes.