|
|
|
|
|
by kllrnohj
2470 days ago
|
|
> benchmark against protobuf decoding Protobuf isn't built into the browser, so it can't bypass the JS parse & execute time. Instead you'd be parsing protobuf's JS, executing it, parsing proto, and producing objects. It'd be worth doing, sure, but it'd almost certainly be the slowest option by far since it's doing way more stuff in JS than either of the other two options and the JS syntax parse is the slow part. |
|
At the end of the day, who knows if the use case hits edge cases or stresses parts of the implementation that is not optimized for JSON decode or protobuf. Getting meaningful performance data ultimately needs to be experimental, and resists categorical answers about whether X is faster than Y.
1. https://www.npmjs.com/package/protobufjs#performance
This article goes into a bit more detail: https://auth0.com/blog/beating-json-performance-with-protobu...