4 ms·
I'm curious if json + simdjson will outperform protobuf. I'm picking a protocol for my project. I was looking at protobuf, but this post made me think otherwis
by billconan 4y ago
I'm curious if json + simdjson will outperform protobuf.
I'm picking a protocol for my project. I was looking at protobuf, but this post made me think otherwise.
- ashvardanian 4y agoYes, even though protobuf is a binary format, it is slower to parse than JSONs with simdjson. Counterintuitive, but that is the power hardware acceleration :)
- billconan 4y agoThank you! Yes, I saw a benchmark somewhere else that also says simdjson is faster than protobuf.
- gituliar 4y agoIs it also the case for floating point data? I know about fast_float (which is by the same author as simdjson), however my believe is that binary format is impossible to beat here.
- neonsunset 4y agoMost protobuf implementations are unfortunately not a good example of high-performance binary serialization code (but still better than the average JSON serialization library! And Go, C# (it provides protobuf almost out of box), Java and Rust implementations appear to be decent). However, your use case is likely doesn't need to process multi-gigabit traffic in JSON requests. Therefore, protobuf, or more specifically, gRPC will be just fine.
- sigg3 4y agoSpeaking of Go, there's a simdjson implementation for golang too: > Performance wise, simdjson-go runs on average at about 40% to 60% of the speed of simdjson. Compared to Golang's standard package encoding/json, simdjson-go is about 10x faster. I haven't tried it yet but I don't really need that speed. https://github.com/minio/simdjson-go https://github.com/minio/simdjson-go