you could try to use a bytebuffer directly and store the vectors in there, or something like that.
Alternativly you could try to see how long the java serializer works (eg objectoutputstream + bytearrayoutputstream) and see if that is faster.
(Hint if it is, your save method can probably be optimized)
Originally the full export of everything I wanted to save was ~8.5 gb of memory and took ~180seconds
I’ve managed, using some of the advice here, to reduce this to ~3.7 gb and ~20 seconds!
Wow! Thanks so much for the advice to put my data into ByteBuffers, that was an incredible boost to speed, and significant boost to memory.
Even saving/loading without any optimizations I was talking about with reducing number of triangles, its below 4gb. That is really great. There is still more I can probably do to get the memory down, but the massive improvement in speed means its more than good enough for now.
Memory was reduced by removing duplicate saved objects, removing objects calculable on read() from write(), reduction of complexity of data saved wherever this didn’t interfere with accuracy of saved data. (ArrayList full of small objects with primitives into one large ByteBuffer).
Thanks for all your help everyone! I probably would have thought of these things eventually but who knows how long it would’ve taken. Thanks again!