import pandas as pd
import matplotlib.pyplot as plt
In this analysis we use report by the python script serde.py (which is located in the repository) executed with such parameters:
python ./serde.py -n=1000 -r=10 --input_path=./data/data_1.json --output_path=./reports/report.csv
Incoming dataset: data_1.json - randomly generated JSON file with demographic data.
Number of executions: 1000 - more on that here
Number of repeats: 10 - more on that here
dt = pd.read_csv("./reports/report.csv")
dt['compression rate'] = 100.0 - dt['size']/dt['size'].max() * 100
dt['serialization_perf_rate'] = dt['serialize']/dt['serialize'].max() * 100
dt['deserialization_perf_rate'] = dt['deserialize']/dt['deserialize'].max() * 100
dt
ax = dt.plot(x='size', y='serialize', kind='scatter', grid=True, figsize=(15,10))
for line in range(0, dt.shape[0]):
ax.annotate(dt.loc[line]['protocol'] + "+" + dt.loc[line]['compression'],(dt.loc[line]['size'], dt.loc[line]['serialize']))
plt.show()
The left down corner is an ideal combination. The protobuf without serialization is on the same level as protobuf + snappy compression.
ax = dt.plot(x='size', y='deserialize', kind='scatter', grid=True, figsize=(15,10))
for line in range(0, dt.shape[0]):
ax.annotate(dt.loc[line]['protocol'] + "+" + dt.loc[line]['compression'],(dt.loc[line]['size'], dt.loc[line]['deserialize']))
plt.show()
Again, protobuf without compression works best for our data record.
For our data struct, which is a map of counters, protobuf without additional compression is a winner.
Protobuf effectively reduces messages which contain only integer values, but when values are strings it doesn't do anything with them. In this case combination of protobuf/msgpack with zlib/snappy may be a solution.