logoalt Hacker News

barishnamazovtoday at 2:05 AM3 repliesview on HN

You shouldn't be using JSON for things that'd have performance implications.


Replies

creationixtoday at 3:38 AM

As with most things in engineering, it depends. There are real logistical costs to using binary formats. This format is almost compact as a binary format while still retaining all the nice qualities of being an ASCII friendly encoding (you can embed it anywhere strings are allowed, including copy-paste workflows)

Think of it as a hybrid between JSON, SQLite, and generic compression. This format really excels for use cases where large read-only build artifacts are queried by worker nodes like an embedded database.

show 1 reply
squirrelloustoday at 4:45 AM

I agree in principle. However JSON tooling has also got so good that other formats, when not optimized and held correctly, can be worse than JSON. For example IME stock protocol buffers can be worse than a well optimized JSON library (as much as it pains me to say this).

show 1 reply
Spivaktoday at 2:19 AM

Can you imagine if a service as chatty and performance sensitive as Discord used JSON for their entire API surface?