Menu

SerializationPerformance

Joern Huxhorn

Serialization performance benchmarks

iMac

java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)

Name
Action
Amount
seconds
Operations/s
total size (raw size)
size/element

protobufUncompressed
encode
2000
0.2
9,930.14
4.96 mebibytes (5207790)
2.54 kibibytes

protobufUncompressed
decode
2000
0.14
14,513.47
4.96 mebibytes (5207790)
2.54 kibibytes

protobufCompressed
encode
2000
0.72
2,764.89
1.34 mebibytes (1410656)
705 bytes

protobufCompressed
decode
2000
0.28
7,030.72
1.34 mebibytes (1410656)
705 bytes

lilithXmlUncompressed
encode
2000
1.06
1,888.14
14.07 mebibytes (14763790)
7.20 kibibytes

lilithXmlUncompressed
decode
2000
0.88
2,262.68
14.07 mebibytes (14763790)
7.20 kibibytes

lilithXmlCompressed
encode
2000
1.92
1,044.2
1.78 mebibytes (1871581)
935 bytes

lilithXmlCompressed
decode
2000
1.1
1,810.36
1.78 mebibytes (1871581)
935 bytes

javaBeansXmlUncompressed
encode
2000
6.66
300.16
45.70 mebibytes (47927790)
23.40 kibibytes

javaBeansXmlUncompressed
decode
2000
6.65
300.98
45.70 mebibytes (47927790)
23.40 kibibytes

javaBeansXmlCompressed
encode
2000
20.36
98.24
3.02 mebibytes (3171561)
1.54 kibibytes

javaBeansXmlCompressed
decode
2000
7.11
281.43
3.02 mebibytes (3171561)
1.54 kibibytes

serializationUncompressed
encode
2000
0.22
9,137.72
8.73 mebibytes (9155790)
4.46 kibibytes

serializationUncompressed
decode
2000
0.44
4,559.46
8.73 mebibytes (9155790)
4.46 kibibytes

serializationCompressed
encode
2000
1.23
1,630.97
2.74 mebibytes (2876649)
1.40 kibibytes

serializationCompressed
decode
2000
2.36
848.9
2.74 mebibytes (2876649)
1.40 kibibytes

streamingSerialization
write
2000
0.16
12,188.66
5.84 mebibytes (6130199)
2.99 kibibytes

streamingSerialization
read
2000
0.16
12,810.25
5.84 mebibytes (6130199)
2.99 kibibytes

protobufUncompressed
add
2000
5.33
375.55
5.05 mebibytes (5295742)
2.58 kibibytes

protobufUncompressed
addAll
2000
0.3
6,685.48
5.05 mebibytes (5295742)
2.58 kibibytes

protobufUncompressed
get
2000
1.86
1,077.46
5.05 mebibytes (5295742)
2.58 kibibytes

protobufCompressed
add
2000
5.65
354.23
1.41 mebibytes (1483538)
741 bytes

protobufCompressed
addAll
2000
0.8
2,490.47
1.41 mebibytes (1483538)
741 bytes

protobufCompressed
get
2000
2.02
988.14
1.41 mebibytes (1483538)
741 bytes

xmlUncompressed
add
2000
12.42
161.03
49.85 mebibytes (52280766)
25.52 kibibytes

xmlUncompressed
addAll
2000
7.44
268.81
49.85 mebibytes (52280766)
25.52 kibibytes

xmlUncompressed
get
2000
9.05
220.98
49.85 mebibytes (52280766)
25.52 kibibytes

xmlCompressed
add
2000
29.88
66.94
3.27 mebibytes (3430938)
1.67 kibibytes

xmlCompressed
addAll
2000
23.94
83.54
3.27 mebibytes (3430938)
1.67 kibibytes

xmlCompressed
get
2000
9.46
211.46
3.27 mebibytes (3430938)
1.67 kibibytes

serializationUncompressed
add
2000
5.42
368.8
9.64 mebibytes (10113882)
4.93 kibibytes

serializationUncompressed
addAll
2000
0.36
5,623.54
9.64 mebibytes (10113882)
4.93 kibibytes

serializationUncompressed
get
2000
2.25
887.66
9.64 mebibytes (10113882)
4.93 kibibytes

serializationCompressed
add
2000
6.53
306.19
3.08 mebibytes (3233414)
1.57 kibibytes

serializationCompressed
addAll
2000
1.37
1,463.19
3.08 mebibytes (3233414)
1.57 kibibytes

serializationCompressed
get
2000
4.28
466.95
3.08 mebibytes (3233414)
1.57 kibibytes


java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Server VM (build 1.5.0_16-133, mixed mode)

Name
Action
Amount
seconds
Operations/s
total size (raw size)
size/element

protobufUncompressed
encode
2000
0.23
8,531.44
4.96 mebibytes (5207790)
2.54 kibibytes

protobufUncompressed
decode
2000
0.16
12,435.57
4.96 mebibytes (5207790)
2.54 kibibytes

protobufCompressed
encode
2000
0.83
2,409.63
1.34 mebibytes (1410656)
705 bytes

protobufCompressed
decode
2000
0.32
6,281.74
1.34 mebibytes (1410656)
705 bytes

serializationUncompressed
encode
2000
0.24
8,328.09
8.73 mebibytes (9155790)
4.46 kibibytes

serializationUncompressed
decode
2000
0.63
3,152.06
8.73 mebibytes (9155790)
4.46 kibibytes

serializationCompressed
encode
2000
1.43
1,400.48
2.74 mebibytes (2876649)
1.40 kibibytes

serializationCompressed
decode
2000
3.31
604.49
2.74 mebibytes (2876649)
1.40 kibibytes

streamingSerialization
write
2000
0.19
10,655.19
5.84 mebibytes (6130199)
2.99 kibibytes

streamingSerialization
read
2000
0.3
6,697.07
5.84 mebibytes (6130199)
2.99 kibibytes

protobufUncompressed
add
2000
4.85
412.23
5.05 mebibytes (5295742)
2.58 kibibytes

protobufUncompressed
addAll
2000
0.4
4,942.87
5.05 mebibytes (5295742)
2.58 kibibytes

protobufUncompressed
get
2000
1.9
1,051.48
5.05 mebibytes (5295742)
2.58 kibibytes

protobufCompressed
add
2000
5.57
358.89
1.41 mebibytes (1483538)
741 bytes

protobufCompressed
addAll
2000
0.98
2,048.88
1.41 mebibytes (1483538)
741 bytes

protobufCompressed
get
2000
2.1
954.52
1.41 mebibytes (1483538)
741 bytes

serializationUncompressed
add
2000
5.04
397.02
9.64 mebibytes (10113882)
4.93 kibibytes

serializationUncompressed
addAll
2000
0.43
4,631.09
9.64 mebibytes (10113882)
4.93 kibibytes

serializationUncompressed
get
2000
2.51
797.47
9.64 mebibytes (10113882)
4.93 kibibytes

serializationCompressed
add
2000
6.27
318.81
3.08 mebibytes (3233414)
1.57 kibibytes

serializationCompressed
addAll
2000
1.66
1,202.31
3.08 mebibytes (3233414)
1.57 kibibytes

serializationCompressed
get
2000
5.45
366.89
3.08 mebibytes (3233414)
1.57 kibibytes


java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

Name
Action
Amount
seconds
Operations/s
total size (raw size)
size/element

protobufUncompressed
encode
2000
0.39
5,092.53
4.96 mebibytes (5207790)
2.54 kibibytes

protobufUncompressed
decode
2000
0.24
8,291.36
4.96 mebibytes (5207790)
2.54 kibibytes

protobufCompressed
encode
2000
1.0
2,006.32
1.34 mebibytes (1410656)
705 bytes

protobufCompressed
decode
2000
0.41
4,865.06
1.34 mebibytes (1410656)
705 bytes

lilithXmlUncompressed
encode
2000
1.55
1,286.91
14.07 mebibytes (14763790)
7.20 kibibytes

lilithXmlUncompressed
decode
2000
1.12
1,792.32
14.07 mebibytes (14763790)
7.20 kibibytes

lilithXmlCompressed
encode
2000
2.38
838.72
1.79 mebibytes (1877359)
938 bytes

lilithXmlCompressed
decode
2000
1.35
1,480.72
1.79 mebibytes (1877359)
938 bytes

javaBeansXmlUncompressed
encode
2000
12.83
155.84
45.70 mebibytes (47927790)
23.40 kibibytes

javaBeansXmlUncompressed
decode
2000
12.33
162.26
45.70 mebibytes (47927790)
23.40 kibibytes

javaBeansXmlCompressed
encode
2000
35.09
56.99
3.02 mebibytes (3171046)
1.54 kibibytes

javaBeansXmlCompressed
decode
2000
12.82
156.04
3.02 mebibytes (3171046)
1.54 kibibytes

serializationUncompressed
encode
2000
0.54
3,691.77
8.73 mebibytes (9155790)
4.46 kibibytes

serializationUncompressed
decode
2000
0.82
2,434.65
8.73 mebibytes (9155790)
4.46 kibibytes

serializationCompressed
encode
2000
1.76
1,136.24
2.74 mebibytes (2876649)
1.40 kibibytes

serializationCompressed
decode
2000
3.71
539.77
2.74 mebibytes (2876649)
1.40 kibibytes

streamingSerialization
write
2000
0.43
4,698.16
5.84 mebibytes (6130199)
2.99 kibibytes

streamingSerialization
read
2000
0.41
4,891.58
5.84 mebibytes (6130199)
2.99 kibibytes

protobufUncompressed
add
2000
5.84
342.23
5.05 mebibytes (5295742)
2.58 kibibytes

protobufUncompressed
addAll
2000
0.57
3,488.63
5.05 mebibytes (5295742)
2.58 kibibytes

protobufUncompressed
get
2000
2.28
875.47
5.05 mebibytes (5295742)
2.58 kibibytes

protobufCompressed
add
2000
6.54
305.87
1.41 mebibytes (1483538)
741 bytes

protobufCompressed
addAll
2000
1.22
1,642.74
1.41 mebibytes (1483538)
741 bytes

protobufCompressed
get
2000
2.27
881.94
1.41 mebibytes (1483538)
741 bytes

xmlUncompressed
add
2000
19.9
100.49
49.85 mebibytes (52280766)
25.52 kibibytes

xmlUncompressed
addAll
2000
14.46
138.36
49.85 mebibytes (52280766)
25.52 kibibytes

xmlUncompressed
get
2000
14.88
134.4
49.85 mebibytes (52280766)
25.52 kibibytes

xmlCompressed
add
2000
48.23
41.47
3.27 mebibytes (3430696)
1.67 kibibytes

xmlCompressed
addAll
2000
42.04
47.57
3.27 mebibytes (3430696)
1.67 kibibytes

xmlCompressed
get
2000
15.72
127.26
3.27 mebibytes (3430696)
1.67 kibibytes

serializationUncompressed
add
2000
6.17
324.33
9.64 mebibytes (10113882)
4.93 kibibytes

serializationUncompressed
addAll
2000
0.74
2,701.21
9.64 mebibytes (10113882)
4.93 kibibytes

serializationUncompressed
get
2000
2.85
701.5
9.64 mebibytes (10113882)
4.93 kibibytes

serializationCompressed
add
2000
7.81
256.16
3.08 mebibytes (3233414)
1.57 kibibytes

serializationCompressed
addAll
2000
2.04
982.27
3.08 mebibytes (3233414)
1.57 kibibytes

serializationCompressed
get
2000
5.98
334.31
3.08 mebibytes (3233414)
1.57 kibibytes

On the old IBM ThinkPad

java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)

Name
Action
Amount
seconds
Operations/s
total size (raw size)
size/element

protobufUncompressed
encode
2000
0.41
4,872.1
4.96 mebibytes (5207790)
2.54 kibibytes

protobufUncompressed
decode
2000
0.2
10,085.97
4.96 mebibytes (5207790)
2.54 kibibytes

protobufCompressed
encode
2000
0.88
2,284.89
1.34 mebibytes (1410656)
705 bytes

protobufCompressed
decode
2000
0.36
5,500.19
1.34 mebibytes (1410656)
705 bytes

lilithXmlUncompressed
encode
2000
2.22
899.46
14.07 mebibytes (14763790)
7.20 kibibytes

lilithXmlUncompressed
decode
2000
1.28
1,561.32
14.07 mebibytes (14763790)
7.20 kibibytes

lilithXmlCompressed
encode
2000
2.86
698.17
1.78 mebibytes (1871581)
935 bytes

lilithXmlCompressed
decode
2000
1.67
1,196.2
1.78 mebibytes (1871581)
935 bytes

javaBeansXmlUncompressed
encode
2000
14.16
141.23
45.70 mebibytes (47927790)
23.40 kibibytes

javaBeansXmlUncompressed
decode
2000
13.5
148.2
45.70 mebibytes (47927790)
23.40 kibibytes

javaBeansXmlCompressed
encode
2000
32.28
61.96
3.02 mebibytes (3170799)
1.54 kibibytes

javaBeansXmlCompressed
decode
2000
14.16
141.23
3.02 mebibytes (3170799)
1.54 kibibytes

serializationUncompressed
encode
2000
0.56
3,567.03
8.73 mebibytes (9155790)
4.46 kibibytes

serializationUncompressed
decode
2000
0.82
2,452.4
8.73 mebibytes (9155790)
4.46 kibibytes

serializationCompressed
encode
2000
2.32
863.48
2.74 mebibytes (2876649)
1.40 kibibytes

serializationCompressed
decode
2000
3.09
646.57
2.74 mebibytes (2876649)
1.40 kibibytes

streamingSerialization
write
2000
0.44
4,498.16
5.84 mebibytes (6130199)
2.99 kibibytes

streamingSerialization
read
2000
0.34
5,903.53
5.84 mebibytes (6130199)
2.99 kibibytes

protobufUncompressed
add
2000
4.68
427.44
5.05 mebibytes (5295742)
2.58 kibibytes

protobufUncompressed
addAll
2000
0.55
3,625.06
5.05 mebibytes (5295742)
2.58 kibibytes

protobufUncompressed
get
2000
1.59
1,259.02
5.05 mebibytes (5295742)
2.58 kibibytes

protobufCompressed
add
2000
4.19
476.81
1.41 mebibytes (1483538)
741 bytes

protobufCompressed
addAll
2000
1.93
1,037.25
1.41 mebibytes (1483538)
741 bytes

protobufCompressed
get
2000
1.09
1,830.65
1.41 mebibytes (1483538)
741 bytes

xmlUncompressed
add
2000
22.33
89.57
49.85 mebibytes (52280766)
25.52 kibibytes

xmlUncompressed
addAll
2000
15.45
129.44
49.85 mebibytes (52280766)
25.52 kibibytes

xmlUncompressed
get
2000
16.54
120.95
49.85 mebibytes (52280766)
25.52 kibibytes

xmlCompressed
add
2000
37.9
52.77
3.27 mebibytes (3429803)
1.67 kibibytes

xmlCompressed
addAll
2000
36.38
54.98
3.27 mebibytes (3429803)
1.67 kibibytes

xmlCompressed
get
2000
15.81
126.51
3.27 mebibytes (3429803)
1.67 kibibytes

serializationUncompressed
add
2000
5.9
339.26
9.64 mebibytes (10113882)
4.93 kibibytes

serializationUncompressed
addAll
2000
0.93
2,157.23
9.64 mebibytes (10113882)
4.93 kibibytes

serializationUncompressed
get
2000
1.57
1,277.49
9.64 mebibytes (10113882)
4.93 kibibytes

serializationCompressed
add
2000
4.53
441.98
3.08 mebibytes (3233414)
1.57 kibibytes

serializationCompressed
addAll
2000
2.8
713.56
3.08 mebibytes (3233414)
1.57 kibibytes

serializationCompressed
get
2000
4.06
492.2
3.08 mebibytes (3233414)
1.57 kibibytes


java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode)

Name
Action
Amount
seconds
Operations/s
total size (raw size)
size/element

protobufUncompressed
encode
2000
0.24
8,293.77
4.96 mebibytes (5207790)
2.54 kibibytes

protobufUncompressed
decode
2000
0.18
11,346.08
4.96 mebibytes (5207790)
2.54 kibibytes

protobufCompressed
encode
2000
1.4
1,425.17
1.34 mebibytes (1410656)
705 bytes

protobufCompressed
decode
2000
0.45
4,476.76
1.34 mebibytes (1410656)
705 bytes

lilithXmlUncompressed
encode
2000
1.57
1,270.09
14.07 mebibytes (14763790)
7.20 kibibytes

lilithXmlUncompressed
decode
2000
1.12
1,790.94
14.07 mebibytes (14763790)
7.20 kibibytes

lilithXmlCompressed
encode
2000
3.21
622.39
1.78 mebibytes (1871581)
935 bytes

lilithXmlCompressed
decode
2000
1.56
1,279.62
1.78 mebibytes (1871581)
935 bytes

javaBeansXmlUncompressed
encode
2000
8.41
237.79
45.70 mebibytes (47927790)
23.40 kibibytes

javaBeansXmlUncompressed
decode
2000
8.06
248.28
45.70 mebibytes (47927790)
23.40 kibibytes

javaBeansXmlCompressed
encode
2000
25.13
79.58
3.02 mebibytes (3170799)
1.54 kibibytes

javaBeansXmlCompressed
decode
2000
8.73
229.15
3.02 mebibytes (3170799)
1.54 kibibytes

serializationUncompressed
encode
2000
0.32
6,222.21
8.73 mebibytes (9155790)
4.46 kibibytes

serializationUncompressed
decode
2000
0.71
2,828.56
8.73 mebibytes (9155790)
4.46 kibibytes

serializationCompressed
encode
2000
2.13
937.63
2.74 mebibytes (2876649)
1.40 kibibytes

serializationCompressed
decode
2000
2.99
668.25
2.74 mebibytes (2876649)
1.40 kibibytes

streamingSerialization
write
2000
0.23
8,845.58
5.84 mebibytes (6130199)
2.99 kibibytes

streamingSerialization
read
2000
0.29
6,990.27
5.84 mebibytes (6130199)
2.99 kibibytes

protobufUncompressed
add
2000
2.34
856.04
5.05 mebibytes (5295742)
2.58 kibibytes

protobufUncompressed
addAll
2000
0.38
5,286.76
5.05 mebibytes (5295742)
2.58 kibibytes

protobufUncompressed
get
2000
0.75
2,650.47
5.05 mebibytes (5295742)
2.58 kibibytes

protobufCompressed
add
2000
3.06
654.04
1.41 mebibytes (1483538)
741 bytes

protobufCompressed
addAll
2000
1.83
1,090.99
1.41 mebibytes (1483538)
741 bytes

protobufCompressed
get
2000
0.9
2,219.71
1.41 mebibytes (1483538)
741 bytes

xmlUncompressed
add
2000
18.25
109.57
49.85 mebibytes (52280766)
25.52 kibibytes

xmlUncompressed
addAll
2000
9.51
210.29
49.85 mebibytes (52280766)
25.52 kibibytes

xmlUncompressed
get
2000
10.23
195.47
49.85 mebibytes (52280766)
25.52 kibibytes

xmlCompressed
add
2000
31.41
63.66
3.27 mebibytes (3429803)
1.67 kibibytes

xmlCompressed
addAll
2000
34.96
57.21
3.27 mebibytes (3429803)
1.67 kibibytes

xmlCompressed
get
2000
10.11
197.9
3.27 mebibytes (3429803)
1.67 kibibytes

serializationUncompressed
add
2000
5.62
355.95
9.64 mebibytes (10113882)
4.93 kibibytes

serializationUncompressed
addAll
2000
0.57
3,502.72
9.64 mebibytes (10113882)
4.93 kibibytes

serializationUncompressed
get
2000
1.44
1,391.89
9.64 mebibytes (10113882)
4.93 kibibytes

serializationCompressed
add
2000
3.69
541.55
3.08 mebibytes (3233414)
1.57 kibibytes

serializationCompressed
addAll
2000
2.53
790.16
3.08 mebibytes (3233414)
1.57 kibibytes

serializationCompressed
get
2000
3.75
534.02
3.08 mebibytes (3233414)
1.57 kibibytes


On a side note: The Lilith event dump (global events) and event splitters (events by source) are using addAll() while the internal Lilith logging appender is using add().


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.