News for hackers. Stuff that matters.
Re:How Turborepo is porting from Go to Rust by wrs on Friday July 21, 2023 @11:32AM (#36814987)
It depends on what you’re marshaling, and how much. Anyway, in my experience, the biggest practical disadvantage of JSON is not performance, it’s that people tend not to put a schema validation/migration layer on top of it, which leads over time to chaos. Many of the popular binary formats have schema validation built in.
Re:How Turborepo is porting from Go to Rust by throwawaymaths on Friday July 21, 2023 @11:44AM (#36815164)
Totally insane that people don't put validation since jsonschema is quite nice
Re:How Turborepo is porting from Go to Rust by packetlost on Friday July 21, 2023 @11:54AM (#36815336)
Text formats have innate issues when it comes to deserialization: you don't know the size of each field of your data until you scan the entire field. This makes deserializers generally more prone to DOS attacks. Many binary formats must necessarily store the size of fields as metadata, which means you might not need to deserialize the whole message to interpret parts of it. Further, JSON doesn't support streaming natively. These are mostly unique use-cases with marginal improvements, but it can matter.