October 7, 2005

serialVersionUID Performance Myth

It would appear that I have been guilty of spreading a myth about improved performance if you declare serialVersionUID in a serializable class.

As Vladimir Roubtsov pointed out a couple of years ago, declaring serialVersionUID has a neglible effect on performance. If not declared the SUID is computed only the first time the JVM serializes an object of a given class. For the curious, read Vladimir's article as well as the details of the SUID computation.

Thanks to Chuck Herrick for alerting me to this. Mea culpa!

Posted to Software Development by Keith Pitty
Comments
Post a comment









Remember personal info?