DEV Community

Cover image for Is There a Faster Alternative to JSON?
dev.to staff for The DEV Team

Posted on

Is There a Faster Alternative to JSON?

What techniques or alternatives have you discovered to improve JSON performance and accelerate application speed?

Follow the DEVteam for more discussions and online camaraderie!

Top comments (7)

Collapse
 
moopet profile image
Ben Sinclair
Collapse
 
jmfayard profile image
Jean-Michel 🕵🏻‍♂️ Fayard • Edited

Something to keep in mind is you should only improve performance after having identified the bottleneck.

It's way more likely that the bottleneck of your app is the speed of the 3G network many people use to access it. Caring about ineficiencies in JSON won't help at that point.

Another way alternatives claim to be faster is by doing less memory allocations than JSON that we typically serialize in one go. This may be a terrible idea because you then move the other more likely bottleneck, memory allocations, from the IO thread where it's fine to the UI thread which is where performacne is criticial.
Flat Buffers aren't fast, they are lazy

So I am in the "JSON in almost all scenarios unless you know exactly what you are doing" camp.

Collapse
 
fyodorio profile image
Fyodor

There are faster and more convenient and solid alternatives definitely, there was even a good post on that here recently, the problem is there's no such simple, universal, flexible, and ubiquitous alternative to it. That's why JSON is a king.

Collapse
 
cereal84 profile image
Alessandro Pischedda
Collapse
 
amustafa16421 profile image
Mustafa_A

Thanks 👍

I am taking it on board :-)

Collapse
 
kaamkiya profile image
Kaamkiya

I don't know about faster, but CSV exists.

Collapse
 
justaguyfrombr profile image
Misael Braga de Bitencourt

If you really need performance, websockets or raw sockets are the faster alternatives.