By eishay
via eishay.blogspot.com
Published: Dec 01 2008 / 10:19
Adding Scala to the serialization benchmarking parade along with Java, Stax, Thrift and Protobuf.
Scala is actually closer to Java, actually as for the serialization engine it IS java since it compiles to java classes. Since you could use Scala in a Java environment like a yet another Jar file then it would be good to check out the serialization cost, especially if you're using RMI, remote Spring or other protocol based on Java serialization.
The surprising part of the Scala compare is that Scala is actually faster in creating objects. To be fair, I've created the exact same objects in Java and Scala and created all the Scala objects from Java code! Creating Scala objects from Scala code might be even faster.
In the chart below size is the size of the object's serialized byte array.



Comments
Ricky Clarkson replied ago:
Scala is not faster than Java. It generates similar bytecode to Java, often slightly slower. Flawed benchmark.
htowninsomniac replied ago:
Badly written. A little more "than", a little less "actually".
Voters For This Link (7)
Voters Against This Link (3)