3 ms·
I thought this was interesting from the roadmap: "The binary protobuf encoding format is not most CPU efficient for browser clients. Furthermore, the generated
by skybrian 8y ago
I thought this was interesting from the roadmap:
"The binary protobuf encoding format is not most CPU efficient for browser clients. Furthermore, the generated code size increases as the total protobuf definition increases.
"For Google's Web applications (e.g. gmail), we use a JSON like format which is comparable to JSON in efficiency but also very compact in both the message size and code size."
I wonder what the benchmarks look like? It seems surprising this hasn't changed with newer browser optimizations.
- romed 8y agoProto encoding makes the unfortunate choice of more-bit variable-length numbers which are hard to decode. JavaScript engines and browser all have very well optimized decoders for the unary length-prefixed variable-length numbers (i.e. UTF-8). So you can imagine how an encoding very much like proto but with the proper style of varints can be faster. Generated code size is a huge problem of all protobuf-supporting languages, not just js. Code size issues on Android have constrained development of the official (google) protobuf libraries in various ways over the years.