fast-serialization
fast-serialization copied to clipboard
How to Version field more than byte capacity (127)
Hi,
Could you tell me how can I change Version annotation capabilities to more than 127? Why this limitation applied?
Thank you
I'm not the author so just theorizing here:
It's probably to keep the size of the serialized steams down to a minimum to save CPU, Memory and Network bandwidth (if streaming across a network). The version is associated with every class.
It would be unlikely that any class would undergo more than 127 changes to its serialization signature (it can have as many method signature and method body changes as it likes without ever needing to increase the version number) in its lifetime.
The version should only be incremented if you add/remove an attribute or change the type of an existing attribute. If that happened to a single class more than 127 times in its lifetime then sounds like something went very wrong somewhere.