Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattheworiordan/nodejs-encoding-benchmarks
Simple repo to benchmark performance of Node.js encoding libraries
https://github.com/mattheworiordan/nodejs-encoding-benchmarks
Last synced: 3 months ago
JSON representation
Simple repo to benchmark performance of Node.js encoding libraries
- Host: GitHub
- URL: https://github.com/mattheworiordan/nodejs-encoding-benchmarks
- Owner: mattheworiordan
- Created: 2015-11-09T16:17:17.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-26T18:57:57.000Z (about 9 years ago)
- Last Synced: 2024-04-13T07:29:44.251Z (9 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node.js binary and string encoding library benchmarks
A simple benchmark test to measure the performance of the following Node.js modules vs JSON:
* [msgpack5](https://www.npmjs.com/package/msgpack5)
* [msgpack](https://www.npmjs.com/package/msgpack)
* [msgpack-js](https://www.npmjs.com/package/msgpack-js)
* [pson](https://www.npmjs.com/package/pson)
* [avsc](https://www.npmjs.com/package/avsc)## Results
$ node benchmark.js
no binary buffers msgpack.pack: 446.188ms
no binary buffers msgpack.unpack: 347.430msno binary buffers msgpack-js.encode: 675.531ms
no binary buffers msgpack-js.decode: 298.495msno binary buffers pson.encode: 1208.759ms
no binary buffers pson.decode: 276.973msno binary buffers avsc.toBuffer: 57.868ms // See [1].
no binary buffers avsc.fromBuffer: 20.666msno binary buffers JSON.stringify: 93.410ms
no binary buffers JSON.parse: 93.165msno binary buffers msgpack5.encode: 22254.455ms
no binary buffers msgpack5.decode: 12134.576ms---
with binary buffers msgpack.pack: 498.184ms
with binary buffers msgpack.unpack: 541.152mswith binary buffers msgpack-js.encode: 878.312ms
with binary buffers msgpack-js.decode: 420.872mswith binary buffers pson.encode: 1596.219ms
with binary buffers pson.decode: 393.904mswith binary buffers avsc.toBuffer: 85.295ms
with binary buffers avsc.fromBuffer: 75.181mswith binary buffers JSON.stringify: 5620.344ms // See [2].
with binary buffers JSON.parse: 788.695mswith binary buffers msgpack5.encode: 33868.102ms
with binary buffers msgpack5.decode: 11560.702msNotes:
1. `avsc` expects the data's structure to be defined upfront using an Avro
schema. See [here](https://github.com/mtth/avsc#examples) for examples and
more information.
2. JSON encoding binary buffers is not relevant as binary data should be
encoded manually in another format. For completeness however, this has been
left in.# About
We ran this simple benchmark test whilst reviewing Node.js encoding options at [Ably Real-time Messaging](https://www.ably.io)