Reputation: 21596
I am implementing a low latency real time application which should push excessive messages.
I would like to ask how different from the performances aspect would be sending Serialized objects or plain long string (which will be parsed as XML in the client side) over TCP connection?
I am talking in Milliseconds terms.
thanks, ray.
Upvotes: 0
Views: 578
Reputation: 10628
Check out https://github.com/eishay/jvm-serializers/wiki/Home/25fd014e66738268670adaf44ff5408ba2244d37 where object serialization frameworks in java are compared
Upvotes: 1
Reputation: 3460
If you're talking about milliseconds, forget about serializing/deserializing Object to XML.
First of all, the serialization/deserialization of Object to XML is already taking sometime. As noted by @Brian Agnew, you also need to diligently check about your XML serialization approach.
Secondly, XML (String) over TCP would not be bandwidth friendly and hence taking longer time to transfer. Google Protocol Buffers offers some advantage on this, though it really depends on the size of your message.
Upvotes: 1
Reputation: 272217
As with all these sorts of questions, I would prototype some approaches and measure the results.
In particular, you've not specified your XML serialisation approach (e.g. XStream, JAXB, parsing via SAX etc.) and that alone will affect your results significantly.
I'm also interested that you're considering (I presume) Java object serialisation vs. XML, and would suggest you also consider approaches such as JSON or Google Protocol Buffers, to name but two.
Finally, see question such as this, which provide a wealth of further info.
Upvotes: 1