Sign in to follow this  
helldoggie666

[java] serialization overhead?

Recommended Posts

helldoggie666    122
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

Share this post


Link to post
Share on other sites
Bacon and Eggs    163
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this