DEV Community

Va Da
Va Da

Posted on

1 1

JSON serialization benchmarks in JavaScript

When you pick a binary JSON serializer from NPM, make sure to check the benchmarks. As it stands, if you need to use CBOR or MessagePack, your best bet is to use json-joy, msgpackr or cbor-x. Maybe, if you really like the features of @msgpack/msgpack, you can use that, but it is not as fast as the other three. Pretty much all other NPM packages are significantly slower than the three mentioned above โ€” if you just pick a random package from NPM, you will most likely get an order of magnitude worse performance than what built-in JSON global provides.

json-joy NPM package ships zero-dependency open source json-pack module, which is the fastest implementations of MessagePack, CBOR, and JSON codecs available for JavaScript. How fast is it?

In this benchmarking blog post we take a look at serialization speeds of various NPM implementations of JSON-like codecs, such as MessagePack, CBOR, JSON, UBJSON, and Amazon Ion.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay