[java] serialization overhead?

Started by
0 comments, last by Bacon and Eggs 16 years, 11 months ago
Hello, I read in some sources that using serialization will makes the application slower. Will this make much difference? Cause when I want to send a map area over the network, you will have the map area's underground array, the object array and maybe some other things. Now I could make a byte object of it, by using the bytebuffer and just use ints and bytes and so on, but is this a good way to work? Is this what they mean by writing your own serialization class? Thx Tim
Advertisement
As far as I know it... yes, you are serializing it when you put it into a stream of bytes... you know, just something so that the other side can deserialize your data package. If that's reading a set of bytes or ints, you are good to go.

If you use the built in java serialization, it's got the kitchen sink approach that handles pretty much most data that an object posesses. It deconstructs your object, passes it along, and then builds a copy of the object on the other side. All that construction and deconstruction is difficult to measure, and mostly made for robustness over speed.

I was told by my java si-fu not to use the java serializer because you may not have java on the other side of the network pipe. Some non java receiver won't know how to build java objects... this may only be important with legacy bits and the like, but, it's another argument for making your own designed class.

This topic is closed to new replies.

Advertisement