Long Strings
This benchmarks compares the performance of the different algorithms when dealing with a structure that contains multiple long strings. Each of the string will be instantiated with large strings (between 100 and 2000 characters) making the total size of the structure close to 4000 bytes.
#![allow(unused)] fn main() { pub struct LongStringStructure { string_one: String, string_two: String, string_three: String, string_four: String, value_one: u32, value_two: u64, } }
Test specs
- Iterations:
k = 10
- Serialization and deserialization repetitions / iteration:
n = 100000
- Data size:
3919
bytes - Protobuf: Supported
Results
1. Windows Execution
Algorithm | Size (b) | Ser. (ms) | Deser. (ms) | Ser+Deser.(ms) |
---|---|---|---|---|
FlatMessage (⚠️) | 3968 [ +1%] | 7.32 [ 6.31 - 8.86] | 20.41 [ 19.69 - 27.33] | 28.22 [ 26.88 - 35.43] |
postcard (schema) | 3915 [ -1%] | 6.56 [ 5.96 - 9.44] | 33.91 [ 31.59 - 41.96] | 39.55 [ 37.61 - 44.44] |
FlatMessage | 3968 [ +1%] | 6.65 [ 5.92 - 9.10] | 34.61 [ 32.12 - 42.88] | 40.63 [ 35.66 - 49.72] |
bincode (schema) | 3920 [ +0%] | 6.23 [ 5.56 - 8.26] | 36.49 [ 34.02 - 43.98] | 43.08 [ 40.01 - 52.90] |
rmp (schema) | 3922 [ +0%] | 5.89 [ 5.33 - 8.05] | 36.31 [ 34.14 - 46.12] | 43.21 [ 40.46 - 56.13] |
protobuf (schema) | 3921 [ +0%] | 7.01 [ 6.50 - 8.47] | 36.34 [ 33.69 - 43.30] | 43.76 [ 40.96 - 52.60] |
rmp | 3989 [ +1%] | 6.71 [ 6.22 - 9.30] | 45.51 [ 41.83 - 59.64] | 54.31 [ 51.52 - 69.65] |
bson | 4014 [ +2%] | 13.09 [ 12.06 - 17.22] | 54.05 [ 50.04 - 66.43] | 71.57 [ 68.23 - 85.13] |
cbor | 3989 [ +1%] | 11.26 [ 10.88 - 15.10] | 78.63 [ 77.29 - 99.97] | 91.99 [ 88.11 - 120.60] |
flexbuffers | 4041 [ +3%] | 107.08 [101.70 - 128.89] | 66.68 [ 64.52 - 77.82] | 185.35 [180.24 - 219.79] |
simd_json | 4011 [ +2%] | 27.61 [ 25.73 - 28.45] | 207.88 [195.33 - 236.90] | 246.34 [231.25 - 276.01] |
json | 4011 [ +2%] | 179.69 [170.16 - 207.78] | 113.51 [104.95 - 122.49] | 298.94 [283.15 - 316.62] |
toml | 4010 [ +2%] | 821.39 [786.00 - 907.08] | 758.25 [713.60 - 796.55] | 1638.54 [1545.04 - 1743.35] |
2. MacOs Execution
Algorithm | Size (b) | Ser. (ms) | Deser. (ms) | Ser+Deser.(ms) |
---|---|---|---|---|
FlatMessage (⚠️) | 3968 [ +1%] | 10.12 [ 10.12 - 10.19] | 18.68 [ 17.35 - 19.51] | 28.32 [ 27.03 - 28.98] |
postcard (schema) | 3915 [ -1%] | 7.23 [ 7.11 - 7.84] | 30.47 [ 30.02 - 31.90] | 37.92 [ 36.72 - 38.88] |
rmp (schema) | 3922 [ +0%] | 6.89 [ 6.88 - 6.91] | 33.27 [ 32.86 - 34.80] | 40.72 [ 40.06 - 42.12] |
FlatMessage | 3968 [ +1%] | 10.27 [ 10.17 - 16.82] | 32.23 [ 31.65 - 42.18] | 41.50 [ 41.16 - 43.73] |
bincode (schema) | 3920 [ +0%] | 7.25 [ 7.24 - 7.33] | 36.81 [ 34.94 - 37.38] | 44.04 [ 41.72 - 44.70] |
protobuf (schema) | 3921 [ +0%] | 8.71 [ 8.67 - 8.79] | 35.99 [ 34.19 - 37.48] | 44.91 [ 43.05 - 46.63] |
rmp | 3989 [ +1%] | 8.27 [ 8.26 - 8.39] | 40.59 [ 39.59 - 42.12] | 49.34 [ 48.31 - 50.44] |
bson | 4014 [ +2%] | 13.56 [ 13.52 - 13.59] | 44.21 [ 43.06 - 44.91] | 58.75 [ 57.73 - 59.61] |
cbor | 3989 [ +1%] | 12.84 [ 12.82 - 12.89] | 72.15 [ 71.56 - 73.79] | 86.91 [ 86.36 - 88.37] |
flexbuffers | 4041 [ +3%] | 71.80 [ 67.99 - 72.59] | 53.19 [ 52.43 - 54.70] | 133.62 [132.45 - 135.85] |
simd_json | 4011 [ +2%] | 42.54 [ 42.40 - 43.27] | 147.50 [145.23 - 149.58] | 191.22 [188.72 - 194.15] |
json | 4011 [ +2%] | 139.28 [138.95 - 139.90] | 85.05 [ 84.74 - 87.02] | 225.44 [224.47 - 229.65] |
toml | 4010 [ +2%] | 1064.13 [1059.03 - 1069.45] | 706.01 [702.41 - 722.81] | 1799.29 [1773.97 - 1810.07] |
3. Linux Execution
Algorithm | Size (b) | Ser. (ms) | Deser. (ms) | Ser+Deser.(ms) |
---|---|---|---|---|
FlatMessage (⚠️) | 3968 [ +1%] | 6.69 [ 6.32 - 8.26] | 12.75 [ 10.84 - 17.90] | 19.76 [ 17.99 - 21.71] |
postcard (schema) | 3915 [ -1%] | 6.42 [ 6.20 - 8.35] | 25.42 [ 23.34 - 29.29] | 31.06 [ 28.77 - 34.33] |
FlatMessage | 3968 [ +1%] | 7.16 [ 6.73 - 8.93] | 25.49 [ 23.42 - 36.57] | 32.13 [ 30.21 - 48.09] |
rmp (schema) | 3922 [ +0%] | 5.79 [ 5.45 - 6.37] | 26.91 [ 25.74 - 43.60] | 32.41 [ 31.64 - 35.81] |
protobuf (schema) | 3921 [ +0%] | 6.72 [ 6.48 - 7.09] | 29.34 [ 25.49 - 31.26] | 36.55 [ 33.42 - 48.14] |
bincode (schema) | 3920 [ +0%] | 6.20 [ 5.90 - 6.60] | 34.71 [ 31.58 - 37.22] | 40.62 [ 37.18 - 43.31] |
rmp | 3989 [ +1%] | 6.52 [ 6.26 - 6.94] | 36.78 [ 35.60 - 39.13] | 43.45 [ 42.51 - 47.37] |
bson | 4014 [ +2%] | 13.06 [ 12.35 - 18.81] | 42.50 [ 38.38 - 44.33] | 58.51 [ 53.93 - 61.10] |
cbor | 3989 [ +1%] | 11.56 [ 10.97 - 15.93] | 67.95 [ 63.18 - 75.39] | 81.07 [ 75.50 - 118.26] |
flexbuffers | 4041 [ +3%] | 84.05 [ 73.17 - 99.47] | 56.81 [ 51.97 - 78.07] | 149.65 [137.27 - 157.13] |
simd_json | 4011 [ +2%] | 27.65 [ 26.27 - 30.50] | 172.07 [163.45 - 203.11] | 204.12 [196.88 - 219.06] |
json | 4011 [ +2%] | 184.73 [178.11 - 234.89] | 94.42 [ 89.33 - 104.79] | 280.38 [271.74 - 289.52] |
toml | 4010 [ +2%] | 767.95 [743.80 - 807.93] | 672.11 [644.87 - 702.78] | 1475.63 [1411.00 - 1501.73] |