← Back to context

Comment by haberman

5 years ago

Article author here. I dumped my test protobuf payload (7506 bytes) to JSON and got 19283 bytes.

So parsing this particular payload at 2GB/s would be equivalent to parsing the JSON version at 5.1GB/s.

SIMD doesn't end up helping protobuf parsing too much. Due to the varint-heavy nature of the format, it's hard to do very much SIMD parallelism. Instead our approach focuses on going for instruction-level parallelism, by trying to remove instruction dependencies as much as possible. With this design we get ~3.5 instructions per cycle in microbenchmarks (which represents a best case scenario).