Java / Java Serialization
How to improve Java serialization performance?
Java serialzation performance directly rely on the number and size of attributes in the Java object. To improve the performance,
- Mark the unwanted or non Serializable attributes as transient.
- Save only the state of the object, not the derived attributes.Some times, serializing them can be expensive.
- Serialize attributes only with NON-default values.
- Use Externalizable interface and implement the readExternal and writeExternal methods to dynamically identify the attributes to be serialized.
More Related questions...