Skip to content

JavaScript

Node benchmarks run on V8 with performance.now() converted to nanoseconds.

Runtime

What it is

This suite measures Node.js, not JavaScript running in a web browser. Node.js is a command-line host that embeds the V8 JavaScript engine, which is the same engine Chrome uses. V8 JIT-compiles (just-in-time compiles) hot functions into native code and reclaims unused objects with a garbage collector. Node also provides Buffer, require/import, and native addons written in C++.

The language is specified by ECMA-262. A short overview is JavaScript. The host is documented in the Node.js API.

This suite
Host Node.js 18 or newer and npm
Engine V8 inside Node.js, not a browser
Prepare Install Node with your package manager, then run npm install in javascript/
Run javascript/scripts/run-benchmarks.sh
Memory V8 garbage collector

What this suite runs

package.json requires Node 18 or newer. Timing uses performance.now() and converts the result to nanoseconds. There is no stream mode. Every codec is timed on in-memory buffers only.

What changes the numbers

V8 compiles hot functions after they have run a few times, so early repetitions can be slower than later ones. Libraries that reuse an Encoder or Packr instance, such as cbor-x and msgpackr, avoid setup work on every call. v8-serialize is a Node-only format. It is not JSON and it is not portable to other languages. Optional native addons such as simdjson are left out of a run when they are not installed.

Calling JSON.stringify in a browser on the same payload is a different environment from this Node runner.

Suite-specific gotchas

devalue is a framework value codec used by tools such as SvelteKit. It is not a portable wire format.

The row named simdjson-parse+JSON.stringify uses SIMD only for parse. Serialize is still the standard JSON.stringify.

These times cannot be ranked against another language, or against a browser.

Where to go next

The steps to install Node and run the benchmark are in javascript/README.md. The platform overview is Introduction to Node.js.

Benchmark runner

  • javascript/ (repository root)
  • Logs: logs/javascript/YYYY-MM-DD-HHMMSS.csv
  • Registration: modular under javascript/src/serializers/
  • prepare() compiles schemas / reuses encoder instances outside timed loops
  • Protobuf codegen: npm run generate:protobuf (protobuf-es + google-protobuf; needs suite protoc sysroot for jspb stubs)
  • Dagr codegen: dagr build in schemas/v2/dagr/ emits TypeScript into javascript/src/generated/dagr/; npm run generate:dagr bundles it (esbuild) into src/generated/dagr_bundle.js

Serializers

34 serializers are registered when the optional simdjson addon loads, and 33 otherwise. That includes fory, gld-kiln, and toon.

The clock wraps serialize and deserialize of an in-memory byte buffer. prepare() is outside the clock. Every row, including the columnar ones, is bytes only: there is no distinct stream loop and no compliance decoder. arrow-ipc times the Arrow IPC stream (tableToIPC(..., 'stream')), not the Arrow file format. Parquet is registered because one nested_table value (struct + list of structs, int32 not widened) round-tripped with hyparquet-writer 0.16.10 and hyparquet 1.31.2. parquet keeps the writer default, Snappy. parquet-uncompressed sets codec: 'UNCOMPRESSED', which changes the bytes and the column codec metadata. That is a second call path of the same writer, not a second library. parquet-wasm is not registered. Schema objects are selected in prepare(). Building the columnar batch from rows is inside timed serialize. table_project deserialize returns f_float_0 only, an array of length N, including N=1.

Name Category Package Optimal API
@msgpack/msgpack Binary @msgpack/msgpack encode / decode
arrow-ipc Columnar apache-arrow tableToIPC / IPC stream reader ('stream', not the file format)
avsc Schema avsc Type.forSchema + toBuffer / fromBuffer
bebop Schema bebop BebopView JSON-model primitives
bser Binary bser dumpToBuffer / loadFromBuffer
bson Binary bson BSON.serialize / deserialize
amf-codec Binary amf-codec toAMF / fromAMF
biorate-amf Binary @biorate/amf encode / decode
cbor Binary cbor encode / decodeFirstSync
cbor-x Binary cbor-x reused Encoder / Decoder
dagr-frozen Schema generated TS (dagr build) arena (built in prepare()) → <Graph>_serde.writeInto a reused Builder / lazy <Type>Accessor.lazyRoot → domain
dagr-frozen-packed Schema generated TS (dagr build) direct builder writeInto a reused Builder / lazy <Type>Accessor.lazyRoot → domain
dagr-packed Schema generated TS (dagr build) direct builder writeInto a reused Builder / lazy <Type>Accessor.lazyRoot → domain
dagr-regular Schema generated TS (dagr build) arena (built in prepare()) → <Graph>_serde.writeInto a reused Builder / lazy <Type>Accessor.lazyRoot → domain
devalue Native devalue stringify / parse
fast-json-stringify JSON fast-json-stringify compile once + JSON.parse
flatbuffers Schema flatbuffers Builder / ByteBuffer
fory Binary @apache-fory/core Registered struct/list codecs; bytes only
flexbuffers Schema flatbuffers (FlexBuffers) encode / toObject
gld-kiln Binary gld-kiln Positional Writer.encode / decode; a batch is one list
google-protobuf Schema google-protobuf official jspb serializeBinary / deserializeBinary
ion-js Binary ion-js dumpBinary / load; plain-object conversion is outside the timer
json-pack-msgpack Binary @jsonjoy.com/json-pack MsgPackEncoder / MsgPackDecoder
JSON.stringify JSON builtin JSON.stringify / JSON.parse
msgpackr Binary msgpackr reused Packr / Unpackr
parquet Columnar hyparquet-writer parquetWriteBuffer (default Snappy) / hyparquet parquetReadObjects
parquet-uncompressed Columnar hyparquet-writer same writer, codec: 'UNCOMPRESSED'
protobuf-es Schema @bufbuild/protobuf create + toBinary / fromBinary
protobufjs Schema protobufjs real fixture Type.encode / decode
sia Binary @timeleap/sia typed-tag JSON-model over Sia primitives
simdjson-parse+JSON.stringify JSON simdjson (optional) ser: JSON.stringify; deser: simdjson.parse
v8-serializer Native node:v8 v8.serialize / v8.deserialize
toon Text @toon-format/toon encode / decode. Size is UTF-8 bytes

Specifics

Why each library exists, what problem it was written to solve, and how. Names link to the source repository (or the stdlib / in-tree path this suite times).

@msgpack/msgpack

The official MessagePack JavaScript implementation (@msgpack/msgpack). MessagePack was created as compact binary JSON. This package is the reference encode/decode API for JS.

arrow-ipc

Apache Arrow was created so analytic engines could share columnar batches without copying each one into a private layout. The problem was a convert-at-every-boundary tax. Arrow IPC is the stream format for those batches. This row times the apache-arrow IPC stream writer and reader (tableToIPC with type stream) inside the suite's bytes mode, not the Arrow file format. Schema objects are selected in prepare. Row-to-column conversion stays inside serialize. table_project deserialize reads f_float_0 only. No compliance decoder.

avsc

avsc brings Apache Avro to JavaScript. Avro was created for compact, schema-driven records in data pipelines. avsc solves the JS side with Type.forSchema and buffer encode/decode.

bebop

Bebop is a schema-driven binary format created as a simpler, faster alternative to protobuf-like IDL stacks for games and services. The problem was heavy generated code and slow encoders. Bebop solves it with a compact schema and generated writers.

bser

BSER is Facebook Watchman's binary protocol: a compact encoding for the watchman's client/server messages. The problem was JSON overhead in a local file-watching daemon. This row times the Node bser dump/load path.

bson

BSON (Binary JSON) was created for MongoDB so documents could be stored and traversed without a text parse. Official language drivers implement that spec. This row times that library's serialize/deserialize path.

amf-codec

amf-codec is a small AMF0 encoder and decoder for Node. AMF0 is the command encoding inside RTMP. The timed path is toAMF and fromAMF on one plain object. It does not write AMF3.

biorate-amf

@biorate/amf is an AMF3 encoder and decoder. The timed path is encode and decode on one plain object. The first byte of an object is the AMF3 object marker. The package does not write Function, XML, or Date. It is a separate row from amf-codec because that library writes AMF0.

cbor

node-cbor implements IETF CBOR (RFC 8949) for Node. CBOR exists as the IETF's binary JSON-like format. The library is a full encode/decode implementation of that RFC.

cbor-x

cbor-x is a high-performance CBOR encoder/decoder for JS, from the same author as msgpackr. The problem was slow or allocating CBOR stacks in Node. It solves that with reusable Encoder/Decoder instances.

dagr-frozen

Dagr ("Data Graph") is a schema-driven binary format that can store shared nodes and cycles, built on an arena model. One Python DSL schema generates the code for every target language (dagr build), so there is no runtime library: the suite commits the generated code from schemas/v2/dagr/schema.py. The five suite types are emitted in all four node layouts, one row each. The graph data type is emitted only for regular and frozen, because a packed reference cannot store the person ring. On suite types, prepare builds the native value and the timed call writes every field (direct builder or arena serializer) and reads them back. This row uses the frozen node layout (positional, no evolution). It also times the graph data type.

dagr-frozen-packed

Dagr ("Data Graph") is a schema-driven binary format that can store shared nodes and cycles, built on an arena model. One Python DSL schema generates the code for every target language (dagr build), so there is no runtime library: the suite commits the generated code from schemas/v2/dagr/schema.py. The five suite types are emitted in all four node layouts, one row each. The graph data type is emitted only for regular and frozen, because a packed reference cannot store the person ring. On suite types, prepare builds the native value and the timed call writes every field (direct builder or arena serializer) and reads them back. This row uses the frozen+packed node layout (positional and inline, no evolution). It does not support the graph data type.

dagr-packed

Dagr ("Data Graph") is a schema-driven binary format that can store shared nodes and cycles, built on an arena model. One Python DSL schema generates the code for every target language (dagr build), so there is no runtime library: the suite commits the generated code from schemas/v2/dagr/schema.py. The five suite types are emitted in all four node layouts, one row each. The graph data type is emitted only for regular and frozen, because a packed reference cannot store the person ring. On suite types, prepare builds the native value and the timed call writes every field (direct builder or arena serializer) and reads them back. This row uses the packed node layout (tagged, evolvable). It does not support the graph data type.

dagr-regular

Dagr ("Data Graph") is a schema-driven binary format that can store shared nodes and cycles, built on an arena model. One Python DSL schema generates the code for every target language (dagr build), so there is no runtime library: the suite commits the generated code from schemas/v2/dagr/schema.py. The five suite types are emitted in all four node layouts, one row each. The graph data type is emitted only for regular and frozen, because a packed reference cannot store the person ring. On suite types, prepare builds the native value and the timed call writes every field (direct builder or arena serializer) and reads them back. This row uses the regular node layout (vtable, evolvable). It also times the graph data type.

devalue

devalue was written (SvelteKit and friends) to stringify richer JavaScript values than JSON allows — dates, maps, cyclical graphs — without eval. The problem was JSON's limited types and eval-based hydrators. devalue solves it with a custom text format.

fast-json-stringify

fast-json-stringify was created in the Fastify ecosystem to serialize JSON from a JSON Schema much faster than JSON.stringify. The problem was that schema-known objects still paid for a fully dynamic walk. It compiles a serializer once and reuses it; this suite decodes with JSON.parse.

flatbuffers

FlatBuffers was created at Google so games and clients could access serialized data without an unpack step. The problem was that protobuf-style decode allocated a full object graph. FlatBuffers solves it with a schema and a binary layout that can be traversed in place.

fory

Apache Fory (formerly Fury) was created for high-performance, cross-language serialization. The problem was that JVM-centric binary codecs and slow portable formats left a gap. Fory registers types and serializes with a compact binary protocol. This row uses @apache-fory/core with registered struct/list schemas and the bytes API.

flexbuffers

FlexBuffers is the schemaless cousin of FlatBuffers. It was created so you can have a FlatBuffers-family binary without compiling a schema. The same Google repository implements it.

gld-kiln

gld-kiln (leo-gan) is a positional little-endian codec. The timed path reuses one writer. There are no field tags on the wire. This row times encode and decode of the suite structs. On the tensor data set this row runs every type. tensor_view borrows the float32 payload and does not copy the matrix.

google-protobuf

This is Google's official JavaScript protobuf runtime (google-protobuf / jspb). It exists so the same .proto contracts can run in JS. The suite times serializeBinary / deserializeBinary.

ion-js

Amazon Ion was created at Amazon as a rich, self-describing superset of JSON (text and binary) for internal services. The problem was JSON's limited types. ion-js is the official JavaScript implementation. This row times binary dump/load; the Ion DOM is turned into plain objects outside the timer.

json-pack-msgpack

json-pack (jsonjoy) is a family of binary codecs including MessagePack. It was written to give JavaScript a fast, modular binary JSON toolkit. This row times the MsgPack encoder/decoder.

JSON.stringify

JSON.stringify / JSON.parse are the ECMAScript standard JSON APIs. They exist so every JavaScript host can speak RFC 8259 without a library. This row times Node's V8 implementation.

msgpackr

msgpackr was written for high-throughput MessagePack in Node, with reusable Packr/Unpackr instances. The problem was that generic MessagePack libraries allocated too much per call. msgpackr solves that with a performance-oriented encoder/decoder.

parquet

Apache Parquet was created as a columnar file for scans that touch a few fields of many rows. The problem was row files that made every reader parse every column. This row times hyparquet-writer parquetWriteBuffer at the library default codec, Snappy, and hyparquet 1.31.2 parquetReadObjects. A nested_table value (struct plus a list of structs, int32 not widened) round-tripped, which is why the row is registered. table_project passes columns ['f_float_0'] on read. SerializerVersion is the writer package. No compliance decoder.

parquet-uncompressed

This is the same hyparquet-writer path as parquet, with codec UNCOMPRESSED. That switch changes the column codec metadata and the bytes. Encodings stay at the library default. It is the same writer, not a second Parquet library. No compliance decoder.

protobuf-es

protobuf-es is Buf's Protocol Buffers implementation for ECMAScript. The problem was that existing JS protobuf stacks did not match modern TypeScript and the official proto3 feature set. It generates TypeScript and times toBinary / fromBinary.

protobufjs

protobuf.js is a popular JavaScript Protocol Buffers implementation that can work from a .proto or a JSON descriptor. The problem was that Google's JS protobuf was awkward in Node. protobuf.js solves it with a JS-native API.

sia

Sia is Timeleap's compact binary tag format for JS values. It was created as a project-specific, typed binary encoding rather than a public interchange standard. This row times those primitive writers.

simdjson-parse+JSON.stringify

simdjson was created to parse JSON at memory-bandwidth speeds using SIMD. The problem was that conventional parsers were far from hardware limits. This row uses simdjson only for parse; serialize is still JSON.stringify. Only deserialize uses SIMD; serialize is stdlib JSON.stringify.

v8-serializer

Node's v8.serialize / v8.deserialize snapshot V8 values. They exist so the engine can persist structured clones, not as a portable wire format. This row times that Node-only API.

toon

@toon-format/toon is the official TypeScript codec and the reference for TOON specification 4.4. The timed path is encode and decode of UTF-8 text. The Size column is that byte length. A token count is not part of the measurement.

Stream I/O

Not measured. The Node suite times the same buffer serialize / deserialize path for every codec; there is no distinct stream API loop. The benchmark runner emits bytes only so the Dashboard / this runner does not claim a second I/O mode. See Modes — stream honesty.

Notes

  • simdjson-parse+JSON.stringify (optional native addon; omitted from the run if not installed): only deserialize uses SIMD; serialize is stdlib JSON.stringify (honest leaderboard label).
  • protobuf-es / google-protobuf use generated code from javascript/schemas/js_fixtures.proto (field shapes match JS data types; string timestamps). Google stubs live under src/generated/google/ (npm run generate:google-protobuf).
  • dagr-packed uses TypeScript generated by dagr build from schemas/v2/dagr/schema.py (one graph per suite type, all nodes packed), bundled to plain ESM with esbuild. Serialize runs only writeInto on direct-builder value objects built in prepare() (i64 fields → BigInt), as protobufjs / protobuf-es build their messages there; the generated writeInto stores into one Builder reused across calls (reset()), and batch records are copied straight into a reused output buffer. Deserialize runs the lazy reader and materializes the domain value inside the timed path. N>1 is framed [u32 count][u32 len][record]….
  • dagr-regular / dagr-frozen / dagr-frozen-packed are the same schema in the other three node layouts (<Type>RegularGraph, <Type>FrozenGraph, <Type>FrozenPackedGraph), sharing the harness code and batch framing with dagr-packed. dagr-frozen-packed encodes exactly like dagr-packed (direct builder, reused Builder). dagr-regular and dagr-frozen have no direct builder: prepare() builds one generated arena per record (the native model, like the protobuf messages) and the timed serialize runs only <Graph>_serde.writeInto(root, B) into the same reused Builder as the direct builder (reset(), writeInto, then the recordBytes view, copied out). Decode is the same lazy-reader → domain path for all four.
  • flatbuffers / flexbuffers: fixture support via tables / FlexBuffers; see the benchmark runner for float/array workarounds.
  • bebop / sia encode a JSON-shaped model via each library’s primitive writers.
  • devalue is a framework-oriented value codec (SvelteKit), not a portable wire standard.
  • prepare() builds native messages and compiles schemas outside the timed path. Columnar schema objects are selected there; building the Arrow or Parquet batch from rows stays inside timed serialize.
  • arrow-ipc / parquet / parquet-uncompressed encode only table, table_project, nested_table, and signal. table_project deserialize returns an array of f_float_0 of length N. Bytes only. No compliance decoder.

Also: javascript/README.md.

Numbers

Measured numbers for this language live on the Dashboard (pre-filtered). Claim level is L1 (one machine, one session) — see Claims and replication.