Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is the most efficient serialization techninqe that must be language independent [closed]

Currently I am starting a project, which needs to serialize the data from .net application ( c# app) and pass it throug a network to a java based server application. Therefore I would like to know which serialization mechanism is most efficient and at the same time serilized objct must be desirialize by java aplication.

queries:

I have heard that protobuf is much more faster than any other serialization like xml. Is is possible to use protobuf to accomplish the above mentioned requirement ??

In java there is newly developed technology named "Kryo" framework for serialization, which is even more efficient than protobuf, so are there any such thing in .net enviornment which must be language independent.

like image 779
UserOverFlow Avatar asked Feb 13 '23 23:02

UserOverFlow


2 Answers

Yes, protobuf is language independent. The java version is provided by google, with multiple C# implementations (I would recommend protobuf-csharp-port if you want very similar code at both ends, and protobuf-net if you prefer the .NET code to look like idiomatic .NET).

Re Kryo - I genuinely don't know enough to comment, but the only way to answer the "is it more efficient" question is to test it (also: define what efficiency means to you: is that serialization size? CPU time? resource usage? or...?). Personally, I'd be a little skeptical that it is going to be smaller, but: there's a sure fire way to find out: you try it.

I do not know whether Kryo is language agnostic, but I can only see Java mentioned.

like image 183
Marc Gravell Avatar answered Feb 23 '23 00:02

Marc Gravell


Hessian is a highly efficient, binary but language independent serialization protocol.

Implementations are available for Java, C++, C#, Objective-C, PHP, Ruby, Javascript etc.

A comparison of the performance of various remote protocol can be found here:
Java Remoting: Protocol Benchmarks

like image 37
Peter Walser Avatar answered Feb 23 '23 00:02

Peter Walser