Is there a simple, hassle-free approach to serialization in Scala/Java that's similar to Python's pickle? Pickle is a dead-simple solution that's reasonably efficient in space and time (i.e. not abysmal) but doesn't care about cross-language accessibility, versioning, etc. and allows for optional customization.
What I'm aware of:
- Java's built-in serialization is infamously slow ([1], [2]), bloated, and fragile. Also have to mark classes as Serializable---annoying when there are things that are clearly serializable but which don't have that annotation (e.g. not many Point2D authors mark these Serializable).
- Scala's BytePickle requires a bunch of boilerplate for every type you want to pickle, and even then it doesn't work with (cyclic) object graphs.
- jserial: Unmaintained and doesn't seem to be that much faster/smaller than the default Java serialization.
- kryo: Cannot (de-)serialize objects with no 0-arg ctors, which is a severe limitation. (Also you have to register every class you plan to serialize, or else you get significant slowdowns/bloat, but even so it's still faster than pickle.)
- protostuff: AFAICT, you have to register every class you intend to serialize in advance in a "schema."
Kryo and protostuff are the closest solutions I've found, but I'm wondering if there's anything else out there (or if there's some way to use these that I should be aware of). Please include usage examples! Ideally also include benchmarks.