Having a native support for JSON is one of the joys of developing a full-stack JavaScript application. JSON is simple, schema-less, and human-readable — qualities especially useful in the early stages of development when our data model is still prone to changes. This flexibility, though, comes at a cost of runtime overhead in size and processing.

JSON, being a text-based format, encodes all values as UTF-8 resulting in size overhead when dealing with non-textual data. It being schema-free means we have to encode the structure of our data models (e.g. object keys) alongside the data. We also do extra work when processing since we have to convert values to their text representation before encoding and decode binary back to text before parsing it as JSON.

#javascript 

 

Tutorial to Binary Protocol for JavaScript
2.40 GEEK