3 ms·
JSON Serialization, seriously ??? Why not "application/octet-stream" header and sending ArrayBuffer over the network ?
by truth_seeker 1y ago
JSON Serialization, seriously ???
Why not "application/octet-stream" header and sending ArrayBuffer over the network ?
- kentonv 1y agoBecause JSON serialization is built into the browser. I'm obviously a huge fan of binary serialization; I wrote Cap'n Proto and Protobuf v2 after all. But when you're working with pure JS, it's hard to be much faster than the built-in JSON implementation, and even if you can beat it, you're only going to get there with a lot of code, and in a browser code footprint often matters more than runtime speed.