Half the bytes, still JSON
{ name: 'Alex', age: 27 } travels as ['Alex', 27]: the keys never repeat, both sides know them from the schema. The payload is plain JSON, so HTTP, WebSocket, brokers, logs and storage take it as it is.
How it works
Objects travel as positional arrays, about half the bytes of JSON, faster than JSON.stringify and JSON.parse, and on records, strings and tagged messages faster to encode than the binary codecs. One metaschema definition validates the values and shapes the wire. No compiler, no dependencies, Node.js and browsers.
protoarray is measured against JSON and eleven JavaScript codecs on the same seven payloads, each library in a fresh process and checked to give the value back before it is timed. The chart shows a round trip, one encode and one decode; pick a scenario, or encode, decode and the payload sizes on their own. protoarray is the fastest encoder on records, strings and tagged messages and has the fastest round trip of one record, decodes faster than JSON on every payload and faster than every codec on long strings, and writes about half the bytes of JSON. msgpackr's shared structures decode faster on the other payloads, and mostly numeric ones are the honest exception, where avsc and msgpackr lead.
Method, cold start, bundle size, release over release and the two backends →