1

In the past, the systems I've worked on have generally used XML to communicate between the client and server and transfer result sets, etc. My current project however simply serializes a list of objects into a binary and sends that across the wire.

We're now coming to a point where our 'transfer objects' (for lack of a better description) could start growing in size due to a bunch of new fields. This, added to the fact that we could in theory have a list of anything up to 100,000 objects sent across, makes me begin to wonder about the relative performance of our current approach vs using XML.

When I say 'performance' I consider:

  • Size of objects being sent across the wire, and time taken
  • Time taken to assemble objects ready for transfer
  • Time taken to parse / deserialize on the other side before we display in the UI

My gut feel is that XML could get very verbose, so might need some kind of compression... but I'm not really familiar with how it scales against serialized binaries. Is there a general consensus on what sort of approach is more scalable, or are we getting into the realm of "fit for purpose" here? :)

Thanks for any advice.

Cheers, Dave.

f1dave
  • 1,167
  • 3
  • 18
  • 29

1 Answers1

2

I think, very generally speaking, there is some consensus that XML serialization is rather verbose and not very fast.

Regarding your binary serialization, since we don't know the implementation, it is kind of hard to judge. You could of course do some performance comparisons yourself.

Also, it might be interesting to look at publicly available implementations of binary protocols and see how they perfom against XML. Protocol buffers and Thrift come to mind.

Also check these: Performance comparison of Thrift, Protocol Buffers, JSON, EJB, other?

https://github.com/eishay/jvm-serializers/wiki/

Community
  • 1
  • 1
lutzh
  • 4,779
  • 1
  • 16
  • 21
  • Thanks. We're using Gemfire's serialization as we have a Gemfire cache... it's supposed to be quite good performance-wise having done a bit more research - but of course I would imagine everything has its limits. May have a poke over at their own forums too. – f1dave May 12 '11 at 09:57