Skip to content

Benchmark

Per Lundberg edited this page Feb 7, 2019 · 5 revisions

OS:Windows 8
JVM:Oracle Corporation 1.7.0_51
CPU:Intel64 Family 6 Model 58 Stepping 9, GenuineIntel os-arch:AMD64
Cores (incl HT):8
1.7.0_51-b13,Java HotSpot™ 64-Bit Server VM,Windows 8

Test Class: FrequentPrimitives[]


A array10 of objects with a typical distribution of primitive fields: 2 short Strings, 3 boolean, 6 ints, 2 long, one double.

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 3526 2690 6216 836
Kryo 2.23 3545 3083 6628 708
Kryo 2.23 UnsafeIn/Output 3740 2955 6695 848
JBoss-River 8236 7729 15965 1017
Java built in 17696 6558 24254 1143
JBoss-Serializer 11306 10030 21336 1143


Test Class: FrequentPrimitivesExternalizable[]


A class with a typical distribution of primitve fields: 2 short Strings, 3 boolean, 6 ints, 2 long, one double. But implementing Externalizable

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 3139 2919 6058 964
Kryo 2.23 3804 3269 7073 722
Kryo 2.23 UnsafeIn/Output 3769 3004 6773 862
JBoss-River 5659 4064 9723 964
Java built in 12669 4058 16727 1065
JBoss-Serializer 9301 5120 14421 1065


Test Class: FrequentCollections


Measures serialization of most popular collection classes. (HashMap and an ArrayList filled with Integer and Long).

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 20393 13026 33419 4671
Kryo 2.23 30672 22339 53011 4622
Kryo 2.23 UnsafeIn/Output 30565 20502 51067 4443
JBoss-River 22232 27133 49365 4515
Java built in 173647 211754 385401 8435
JBoss-Serializer 203630 206014 409644 8435


Test Class: LargeNativeArrays


measures performance serializing a large int array, a large long array and a large double array filled with random values. Note that random values destroy any value compression, so the increased size of kryo in this test will not be observable in most real world data.

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 28524 24239 52763 31219
Kryo 2.23 55367 52211 107578 34928
Kryo 2.23 UnsafeIn/Output 8181 2890 11071 31210
JBoss-River 36417 41448 77865 31339
Java built in 34288 24243 58531 31403
JBoss-Serializer 41264 38946 80210 31403


Test Class: StringPerformance


measures serialization of mid size to very long Strings

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 28556 17936 46492 20020
Kryo 2.23 60464 46067 106531 17716
Kryo 2.23 UnsafeIn/Output 60762 45727 106489 17716
JBoss-River 56149 47332 103481 17820
Java built in 65148 79500 144648 17931
JBoss-Serializer 124372 65887 190259 17931


Test Class: Primitives


A broad test of primitive values and specials such as Enums, EnumSets, Date, String, byte, short, int, .. Byte, Character; Short, Integer, ..
plus opaque private field with same name in a private subclass

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 10246 10641 20887 1450
Kryo 2.23 FAIL 0 0 0 0
Kryo 2.23 UnsafeIn/Output FAIL 0 0 0 0
JBoss-River 53017 27206 80223 3048
Java built in 129927 29994 159921 3614
JBoss-Serializer 64364 51162 115526 3669


Test Class: Arrays[]


Tests various arrays of int, Dimension, Date, Object. Nested arrays, multidimensional arrays.

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 75178 51420 126598 22764
Kryo 2.23 74964 66118 141082 9681
Kryo 2.23 UnsafeIn/Output 60051 48458 108509 16471
JBoss-River 71280 71976 143256 16691
Java built in 185603 99698 285301 20774
JBoss-Serializer 109893 118335 228228 20774


Test Class: CommonCollections


In depth test of collections incl. collections of collections.
(ArrayList, ArrayDeque, ConcurrentLinkedQueue, Vector, TreeSet, LinkedList, TreeMap, ConcurrentHashMap, Hashtable, HashMap). Note: has been modified to workaround Kryo-specific Issue.

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 61424 41091 102515 8502
Kryo 2.23 130631 63113 193744 8323
Kryo 2.23 UnsafeIn/Output 130528 58081 188609 9408
JBoss-River 86097 96098 182195 9886
Java built in 264432 170642 435074 13172
JBoss-Serializer 207469 177768 385237 13172


Test Class: Trader


Measures serialization of a typical ‘Enterprise-Object’ using Value-Classes instead of primitive types.

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 55414 50554 105968 5192
Kryo 2.23 83995 79361 163356 5919
Kryo 2.23 UnsafeIn/Output 80578 72693 153271 5928
JBoss-River 147758 163913 311671 7210
Java built in 235082 198167 433249 11075
JBoss-Serializer 240648 244351 484999 11075


Test Class: ManyClasses


Tests speed serializing a complex object graph of many different classes with few primitive fields.

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 6033 3505 9538 1000
Kryo 2.23 8515 5857 14372 1220
Kryo 2.23 UnsafeIn/Output 8016 5699 13715 1283
JBoss-River 45683 20969 66652 2322
Java built in 117495 22179 139674 3062
JBoss-Serializer 61371 53098 114469 3062


Test Class: ExternalizableTest


Performance of Externalizable objects.

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 69791 95543 165334 10137
Kryo 2.23 95705 91131 186836 4733
Kryo 2.23 UnsafeIn/Output 99192 89063 188255 7507
JBoss-River 123767 129922 253689 13291
Java built in 191301 173988 365289 14840
JBoss-Serializer 144327 143785 288112 14840


Test Class: BigObject


A bigger object graph consisting of some of the test objects at once

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 3536985 3718992 7255977 432548
Kryo 2.23 5016964 4028313 9045277 322340
Kryo 2.23 UnsafeIn/Output 4959939 3887250 8847189 396290
JBoss-River 5159753 6579654 11739407 482426
Java built in 7663914 8553681 16217595 588458
JBoss-Serializer 7782434 8144898 15927332 588458


Test Class: HeavyNesting


Heavily nested Objects

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 56347 65469 121816 3747
Kryo 2.23 78839 86746 165585 5009
Kryo 2.23 UnsafeIn/Output 75165 76354 151519 7076
JBoss-River 159585 205498 365083 7115
Java built in 169928 203160 373088 10182
JBoss-Serializer 249022 247533 496555 10182


Test Class: MediaContent


measures serializing the cyclefree object structure used by one of the most known encoding/decoding tests

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 1813 1308 3121 316
Kryo 2.23 2244 1729 3973 286
Kryo 2.23 UnsafeIn/Output 2130 1696 3826 307
JBoss-River 9529 5870 15399 694
Java built in 35706 6289 41995 889
JBoss-Serializer 13272 13020 26292 856


Test Class: ShortRemoteCall


measures overhead of stream initialization+classname decoding. Only one very short object is serialized

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 280 188 468 15
Kryo 2.23 354 285 639 32
Kryo 2.23 UnsafeIn/Output 337 261 598 36
JBoss-River 2641 1577 4218 172
Java built in 9031 1303 10334 220
JBoss-Serializer 4531 2720 7251 220


Test Class: SmallThing


only one int. benches pure init time

read+write (ns)

size (bytes)


lib                                     read (ns)     write (ns)     total (ns)   size (bytes)
FST 157 132 289 2
Kryo 2.23 122 107 229 2
Kryo 2.23 UnsafeIn/Output 113 105 218 5
JBoss-River 2121 1139 3260 102
Java built in 4468 746 5214 100
JBoss-Serializer 2491 1370 3861 100

You can’t perform that action at this time.