3 ms·
Being able to debug through a simple curl or browser devtools is golden. Also browser has JSON parsing built in. Less dependencies. Easier tooling overall. In
by cmrdporcupine 4y ago
Being able to debug through a simple curl or browser devtools is golden.
Also browser has JSON parsing built in. Less dependencies. Easier tooling overall.
In my experience people overuse protobuf. But I also worked at Google, where it's the hammer in constant search of any nail it can find.
At the very least, endpoints should provide the option to provide a JSON form through content representation negotiation.
- franciscop 4y agoWhen the library decoding the data is falling with weird errors, and you open the devtools in the browser and the data being transmitted is all in binary, well you have a very hard time debugging things. We moved to flatbuffers and back to JSON because in the end of the day, for our data, data compression with JSON+gzip was similarly-sized than the original one (which had some other fields that we were not using) and 10-20 times faster to decode.
- cmrdporcupine 4y agoTruth. That said, the use case for flatbuffers and capnproto isn't really about data size, it's about avoiding unnecessary copies in the processing pipeline. "Zero copy" really does pay dividends where performance is a concern if you write your code the right way. Most people working on typical "web stack" type applications won't hit these concerns. But there are classes of applications where what flatbuffers (and other zerocopy payload formats) offer is important. The difference in computation time between operating on something sitting in L1 cache vs not-in-cache is orders of magnitude. And memory bandwidth is a bottleneck in some applications and on some machines (particularly embedded.)