Large Vectors

This benchmarks compares the performance of the different algorithms when dealing with a structure that contains multiple large vectors. The vectors will be instantiated as follows:

  • ints: 2000 elements between 200 and 220
  • floats: 10000 elements between -1000000.0 and 1000000.0
  • uints: 25000 elements between 0 and 1000000
  • doubles: 30000 elements between 0.0 and 1000000.0
#![allow(unused)]
fn main() {
pub struct LargeVectors {
    ints: Vec<i32>,
    floats: Vec<f32>,
    uints: Vec<u32>,
    doubles: Vec<f64>,
}
}

Test specs

  • Iterations: k = 10
  • Serialization and deserialization repetitions / iteration: n = 100
  • Data size: 388008 bytes
  • Protobuf: Supported

Results

1. Windows Execution

AlgorithmSize (b)Ser. (ms)Deser. (ms)Ser+Deser.(ms)
FlatMessage388060
[ +0%]
1.40
[ 1.31 - 2.61]
1.32
[ 1.12 - 13.24]
2.65
[ 2.28 - 13.78]
FlatMessage (⚠️)388060
[ +0%]
1.35
[ 1.15 - 2.55]
1.37
[ 1.00 - 14.00]
2.68
[ 2.37 - 12.95]
bincode (schema)407012
[ +4%]
15.50
[ 13.72 - 25.95]
14.02
[ 11.95 - 23.81]
29.96
[ 25.90 - 46.78]
postcard (schema)358260
[ -8%]
20.11
[ 17.25 - 24.88]
10.63
[ 9.43 - 15.52]
30.74
[ 26.41 - 42.54]
protobuf (schema)358265
[ -8%]
17.05
[ 14.16 - 39.22]
15.39
[ 13.50 - 29.45]
32.28
[ 27.52 - 64.30]
rmp445039
[ +14%]
16.85
[ 14.12 - 33.93]
27.71
[ 23.07 - 48.36]
45.39
[ 38.31 - 75.90]
rmp (schema)445013
[ +14%]
16.50
[ 13.82 - 32.05]
27.73
[ 25.33 - 52.29]
45.46
[ 39.83 - 91.06]
cbor320339
[ -18%]
49.73
[ 43.10 - 64.13]
94.20
[ 84.26 - 111.31]
145.84
[131.47 - 170.92]
flexbuffers264099
[ -32%]
66.30
[ 58.72 - 98.01]
110.55
[ 97.93 - 156.83]
180.88
[157.36 - 243.98]
json539243
[ +38%]
265.55
[227.27 - 308.44]
99.88
[ 94.64 - 116.47]
353.35
[330.89 - 417.55]
bson960615
[+147%]
190.55
[157.87 - 219.51]
244.22
[204.61 - 285.33]
432.94
[371.42 - 504.68]
simd_json539243
[ +38%]
286.91
[262.48 - 337.45]
177.50
[167.55 - 199.11]
482.78
[433.14 - 559.85]
toml606238
[ +56%]
350.72
[314.07 - 397.58]
1259.97
[1051.49 - 1489.37]
1622.38
[1398.75 - 2618.01]

2. MacOs Execution

AlgorithmSize (b)Ser. (ms)Deser. (ms)Ser+Deser.(ms)
FlatMessage (⚠️)388060
[ +0%]
0.93
[ 0.89 - 1.03]
0.71
[ 0.67 - 0.92]
2.70
[ 2.45 - 2.81]
FlatMessage388060
[ +0%]
0.96
[ 0.93 - 1.13]
0.73
[ 0.68 - 0.83]
2.87
[ 2.69 - 2.94]
postcard (schema)358260
[ -8%]
13.56
[ 13.41 - 14.09]
6.30
[ 6.19 - 8.04]
19.89
[ 19.85 - 22.84]
bincode (schema)407012
[ +4%]
9.23
[ 9.21 - 9.53]
10.84
[ 8.63 - 14.85]
21.19
[ 17.81 - 23.30]
protobuf (schema)358265
[ -8%]
10.77
[ 10.75 - 11.20]
19.54
[ 17.00 - 20.37]
30.52
[ 27.59 - 31.33]
rmp (schema)445013
[ +14%]
17.62
[ 17.35 - 17.97]
31.95
[ 31.46 - 33.94]
50.05
[ 49.24 - 54.93]
rmp445039
[ +14%]
17.35
[ 17.31 - 20.36]
33.35
[ 31.54 - 37.02]
51.29
[ 49.43 - 54.87]
flexbuffers264099
[ -32%]
60.09
[ 58.93 - 61.57]
61.73
[ 59.33 - 67.41]
125.72
[123.06 - 134.17]
cbor320339
[ -18%]
46.99
[ 46.91 - 48.50]
81.21
[ 80.76 - 83.73]
128.18
[127.71 - 153.43]
bson960615
[+147%]
118.51
[118.05 - 122.29]
153.30
[149.42 - 157.42]
274.78
[266.38 - 295.11]
json539243
[ +38%]
194.88
[193.23 - 231.19]
82.23
[ 78.61 - 85.68]
280.23
[272.33 - 286.06]
simd_json539243
[ +38%]
214.50
[212.87 - 247.29]
98.83
[ 95.00 - 120.02]
317.99
[313.92 - 326.43]
toml606238
[ +56%]
202.20
[200.94 - 213.92]
672.79
[658.82 - 697.97]
873.71
[862.31 - 902.96]

3. Linux Execution

AlgorithmSize (b)Ser. (ms)Deser. (ms)Ser+Deser.(ms)
FlatMessage (⚠️)388060
[ +0%]
1.22
[ 1.16 - 1.54]
0.76
[ 0.72 - 1.03]
2.13
[ 2.04 - 2.74]
FlatMessage388060
[ +0%]
1.26
[ 1.23 - 1.41]
0.87
[ 0.76 - 6.82]
2.25
[ 2.20 - 8.84]
bincode (schema)407012
[ +4%]
14.85
[ 14.56 - 17.53]
11.55
[ 11.24 - 12.21]
26.87
[ 25.97 - 28.12]
postcard (schema)358260
[ -8%]
18.27
[ 18.04 - 18.98]
9.13
[ 8.96 - 9.41]
27.82
[ 27.22 - 28.42]
protobuf (schema)358265
[ -8%]
15.06
[ 14.80 - 15.38]
13.69
[ 13.37 - 13.83]
28.67
[ 27.97 - 30.95]
rmp445039
[ +14%]
14.73
[ 14.50 - 20.30]
31.12
[ 30.26 - 50.68]
46.66
[ 44.98 - 74.95]
rmp (schema)445013
[ +14%]
13.87
[ 13.68 - 16.92]
31.77
[ 30.92 - 34.81]
47.12
[ 45.69 - 58.30]
cbor320339
[ -18%]
53.78
[ 53.01 - 75.71]
89.73
[ 87.73 - 121.95]
145.53
[142.69 - 153.50]
flexbuffers264099
[ -32%]
58.48
[ 57.33 - 73.69]
107.12
[106.37 - 142.04]
165.70
[162.62 - 221.79]
json539243
[ +38%]
194.15
[191.85 - 200.21]
95.20
[ 94.02 - 97.09]
291.55
[284.73 - 343.34]
simd_json539243
[ +38%]
221.01
[218.67 - 237.59]
110.15
[106.49 - 192.84]
333.07
[329.37 - 396.38]
bson960615
[+147%]
178.64
[172.46 - 186.55]
218.06
[212.31 - 234.52]
403.27
[388.82 - 439.16]
toml606238
[ +56%]
307.17
[301.41 - 389.19]
898.43
[881.22 - 975.59]
1215.07
[1176.29 - 1272.70]