Skip to content

protoarraySchema-based serialization that stays JSON

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

Benchmarks ​

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.

One record: round trip
One record: 10 fields, nested address, tags, 2 orders. Encode one payload and decode it, payloads a second, linear scale, higher is better. The line marks JSON.
protoarraycodegen
940k
msgpackrrecords, shared structures
916k
protoarraystandalone module, no eval
899k
avscType.forSchema
840k
protobufjsreflection, Root.fromJSON
717k
protoarraycodegen + metaschema check
689k
protoarrayclosures, no eval
623k
fast-json-stringifycompiled stringify, JSON.parse
615k
JSONstringify · parse
572k
msgpackrpack · unpack
442k
cbor-xrecords
358k
@msgpack/msgpackEncoder · Decoder
356k
v8.serializestructured clone, Node only
277k
BSONserialize · deserialize
273k
protobuf-escreate · toBinary · fromBinary
261k
devaluestringify · parse
184k
superjsonstringify · parse
109k
Apple M3 Max · 16 cores · Node v24.14.1 · median of 5 × 400 ms rounds, each library and scenario in a fresh process · 2026-10-16

Method, cold start, bundle size, release over release and the two backends →

Released under the MIT License.