What techniques or alternatives have you discovered to improve JSON performance and accelerate application speed?
Follow the DEVteam for more discussions and online camaraderie!
What techniques or alternatives have you discovered to improve JSON performance and accelerate application speed?
Follow the DEVteam for more discussions and online camaraderie!
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (7)
Some of this has been talked about in this recent post:
JSON is Slower. Here Are Its 4 Faster Alternatives
Nik L. ・ Oct 31 '23
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.
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.
Try msgpack.org/index.html.
Thanks 👍
I am taking it on board :-)
I don't know about faster, but CSV exists.
If you really need performance, websockets or raw sockets are the faster alternatives.