Skip to content

Instantly share code, notes, and snippets.

@kriszyp
Last active January 10, 2021 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kriszyp/f054293ef3a152b7471dd2c122406564 to your computer and use it in GitHub Desktop.
Save kriszyp/f054293ef3a152b7471dd2c122406564 to your computer and use it in GitHub Desktop.
operation op ms op/s
buf = Buffer(JSON.stringify(obj)); 82000 5004 16386
obj = JSON.parse(buf); 88600 5000 17720
require('msgpackr').pack(obj); 161500 5002 32287
require('msgpackr').unpack(buf); 94600 5004 18904
msgpackr w/ shared structures: packr.pack(obj); 178400 5002 35665
msgpackr w/ shared structures: packr.unpack(buf); 376700 5000 75340
buf = require('msgpack-lite').encode(obj); 30100 5012 6005
obj = require('msgpack-lite').decode(buf); 16200 5001 3239
buf = require('notepack').encode(obj); 62600 5005 12507
obj = require('notepack').decode(buf); 32400 5007 6470
require('what-the-pack')... encoder.encode(obj); 63500 5002 12694
require('what-the-pack')... encoder.decode(buf); 32000 5001 6398
require('avsc')...make schema/type...type.toBuffer(obj); 84600 5003 16909
require('avsc')...make schema/type...type.toBuffer(obj); 99300 5001 19856
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment