-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider / evaluate non-native Serialization to session #7
Comments
Interesting benchmarks. At a first look it seems that, apart from performance, Kryo seems easier to customize, has better documentation and also some OOB serializer implementation in a side project (eg CGLib proxy). One thing we also should considered is the possibility to have in session some objects with custom serialization logic that should be executed; this happens for some Vaadin classes but could also happen for application specific classes (maybe from third party libraries). In a custom serialization process (Kryo, protostuff or whatever) this cases should be somehow intercepted in order to apply default java serialization. |
I agree, there could be a requirement to Serialise almost anything, so ease of customisation would be a significant factor
There are many use cases for custom Serialization, but once a serialiser (eg, Kryo) is employed, I cannot think of a reason to drop back into native Java serialisation. Could you give an example of what you are thinking of? For Kryo certainly, and possibly others, it might be interesting to see how the registration of common Vaadin classes might affect performance - but that could be left for a second iteration. |
Here I'm thinking more about deserialization; a class could have some transient fileds that will be reinitialized in So my concern is not about performance but about object integrity after deserialization |
Ah, now I understand your concern. At a quick look, the main difference here is that native deserialisation does not use a constructor, Kryo does. Ironically, most transient field initialisation does the same as object construction, but that cannot be guaranteed - some cases may do something completely different. So you are right, potentially there is a need to replicate all readObject() implementations. This could be a major problem when used with code which you do not control. I wonder if it is worth a question to the Kryo forum - this must surely be a common problem? |
To capture our conversation about Serialization performance and specifically Kryo
Here are some benchmarks - Kryo does well, but maybe protostuff may be even quicker..
The text was updated successfully, but these errors were encountered: