logoalt Hacker News

magicalhippotoday at 12:23 PM1 replyview on HN

> The real cost with JSON is when you have a 200MB manifest or build artifact and you need exactly two fields out of it.

There are SAX-like JSON libraries out there, and several of them work with a preallocated buffer or similar streaming interface, so you could stream the file and pick out the two fields as they come along.


Replies

IshKebabtoday at 1:22 PM

You still have to parse half the entire file on average. Much slower than formats that support skipping to the relevant information directly.

show 1 reply