Hacker News new | ask | show | jobs
by truth_seeker 264 days ago
JSON Serialization, seriously ???

Why not "application/octet-stream" header and sending ArrayBuffer over the network ?

1 comments

Because 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.