Cloneable versus Serializable

Could someone suggest that how much the performance will be impacted if Serializable interface is used to clone java objects.  org.apache.commons.lang.SerializationUtils provides a method clone() to clone any serializable object but it says its slower.  Any other alternative of cloning?  Not sure if there is any benchmark tool available for this?
Who is Participating?
Ajay-SinghConnect With a Mentor Commented:
I am not sure what you mean by alternative to cloning. But there are
other libraries like xstream, which also does serialization, and pretty
fast too
I would think clone to be faster than serialzable, as serilazation has
to walk through the object graph to store the state of the object. While
in cloning, the user can simply call other construtor to create a new
fix2009Author Commented:
So is there any other alternative of cloning an object other than clone() method?  I am actually looking for if I dont have to maintain clone method when new properties are added to the object.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.