4 ms·
These binary protocols generally also try to keep the data size small. Protobuf is essentially compressing its integers (varint or zigzag encoding), for example
by nitwit005 1y ago
These binary protocols generally also try to keep the data size small. Protobuf is essentially compressing its integers (varint or zigzag encoding), for example.
It'd be helpful to see a plot of serialization costs vs data size. If you only display serialization TPS, you're always going to lose to the "do nothing" option of just writing your C structs directly to the wire, which is essentially zero cost.
- stmw 1y agoIt appears there are two schema compatibility modes and no guarantee of minor version binary compatibility.
- chaokunyang 1y agoFory also compress integers using varint or zigzag encoding. The size are basically same: | data type | data size | fory | protobuf | | --------------- | --------- | ------- | -------- | | simple-struct | small | 21 | 19 | | simple-struct | medium | 70 | 66 | | simple-struct | large | 220 | 216 | | simple-list | small | 36 | 16 | | simple-list | medium | 802 | 543 | | simple-list | large | 14512 | 12876 | | simple-map | small | 33 | 36 | | simple-map | medium | 795 | 1182 | | simple-map | large | 17893 | 21746 | | person | small | 122 | 118 | | person | medium | 873 | 948 | | person | large | 7531 | 7865 | | company | small | 191 | 182 | | company | medium | 9118 | 9950 | | company | large | 748105 | 782485 | | e-commerce-data | small | 750 | 737 | | e-commerce-data | medium | 53275 | 58025 | | e-commerce-data | large | 1079358 | 1166878 | | system-data | small | 311 | 315 | | system-data | medium | 24301 | 26161 | | system-data | large | 450031 | 479988 |