Re:Ask HN: What are you working on this weekend?
by app17 on Saturday November 20, 2021 @08:21AM
(#29287830)
Cool project! I couldn't find any benchmark. How does it compare to protobuf/json/... performance wise?
Re:Ask HN: What are you working on this weekend?
by kstenerud on Saturday November 20, 2021 @10:33AM
(#29288941)
There's a benchmark test in the go implementation that gets 30-50% better performance than go's stdlib JSON. Mind you, this is a reference implementation and built for study, not speed.
Ultimately, performance in go comes down to how many allocations you do.
In a nutshell:
- Existing ad-hoc formats are too loosely defined to be secure, and that's becoming a huge problem as the bad guys become more sophisticated. CE is tightly specified and designed to mitigate exploitation of codecs.
- CE is a twin text and binary format. Humans view and edit in text, and machines send it in binary, so you get the convenience of text and the efficiency of binary for free.
- CE supports the fundamental types natively. Stringifying is buggy, causes incompatibilities, and opens security holes. And it's completely unnecessary with a properly designed data format.
[1] https://github.com/kstenerud/go-concise-encoding
[2] https://concise-encoding.org/
[3] https://github.com/kstenerud/concise-encoding