Domanda

One of my class has to serialize huge numbers of instances and using Xstream, the file size becomes like 30MB when it's done. The size isn't really problem as it will be like 100KB when compressed since the data are very repeative. But it takes lots of time to serialize/de-serialize.

I tried using kyro but I didn't really like it. Is there any way to optimize XStream to serialize huge data or is there better library I can use?

È stato utile?

Soluzione

I'd wonder why your class has to store huge numbers of repetitive instances. If they take time to serialize, they're taking up RAM as well. I'd use a Set or another data structure to eliminate the repetition in memory. It'll help your serialization as well.

If that's not possible, I'd say that there's no way to help your serialization issue either.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top