From cb20785dd9f3bc5d212a1ea756b3d7973c26f1b7 Mon Sep 17 00:00:00 2001 From: Jesse Armand Date: Mon, 30 Nov 2015 23:16:30 +0800 Subject: [PATCH 1/2] Fixed benchtable dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c9aba7f..a9f40ee 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "homepage": "https://github.com/coinative/notepack", "devDependencies": { "benchmark": "^1.0.0", - "benchtable": "0.0.2", + "benchtable": "^0.0.5", "chai": "^1.9.1", "istanbul": "^0.2.10", "mocha": "^1.18.2", From f5c0ff8ac4e10fdab15849789540d7eb24c67e6e Mon Sep 17 00:00:00 2001 From: Jesse Armand Date: Mon, 30 Nov 2015 23:44:05 +0800 Subject: [PATCH 2/2] Added msgpack-lite to the comparison. --- benchmarks/decode.js | 12 ++++++++---- benchmarks/encode.js | 4 ++++ package.json | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/benchmarks/decode.js b/benchmarks/decode.js index 2cbfde4..feed6bd 100644 --- a/benchmarks/decode.js +++ b/benchmarks/decode.js @@ -1,6 +1,7 @@ var notepack = require('../'); var msgpackJs = require('msgpack-js'); var msgpackNode = require('msgpack'); +var msgpackLite = require('msgpack-lite'); var data = require('./data'); var Benchtable = require('benchtable'); @@ -11,6 +12,9 @@ suite .addFunction('notepack', function (m, js, node, json) { notepack.decode(m); }) +.addFunction('msgpack-lite', function (m, js, node, json) { + msgpackLite.decode(m); +}) .addFunction('msgpack-js', function (m, js, node, json) { msgpackJs.decode(js); }) @@ -22,10 +26,10 @@ suite JSON.parse(json.toString()); }) -.addInput('tiny', [notepack.encode(data.tiny), msgpackJs.encode(data.tiny), msgpackNode.pack(data.tiny), new Buffer(JSON.stringify(data.tiny))]) -.addInput('small', [notepack.encode(data.small), msgpackJs.encode(data.small), msgpackNode.pack(data.small), new Buffer(JSON.stringify(data.small))]) -.addInput('medium', [notepack.encode(data.medium), msgpackJs.encode(data.medium), msgpackNode.pack(data.medium), new Buffer(JSON.stringify(data.medium))]) -.addInput('large', [notepack.encode(data.large), msgpackJs.encode(data.large), msgpackNode.pack(data.large), new Buffer(JSON.stringify(data.large))]) +.addInput('tiny', [notepack.encode(data.tiny), msgpackLite.encode(data.tiny), msgpackJs.encode(data.tiny), msgpackNode.pack(data.tiny), new Buffer(JSON.stringify(data.tiny))]) +.addInput('small', [notepack.encode(data.small), msgpackLite.encode(data.small), msgpackJs.encode(data.small), msgpackNode.pack(data.small), new Buffer(JSON.stringify(data.small))]) +.addInput('medium', [notepack.encode(data.medium), msgpackLite.encode(data.medium), msgpackJs.encode(data.medium), msgpackNode.pack(data.medium), new Buffer(JSON.stringify(data.medium))]) +.addInput('large', [notepack.encode(data.large), msgpackLite.encode(data.large), msgpackJs.encode(data.large), msgpackNode.pack(data.large), new Buffer(JSON.stringify(data.large))]) .on('complete', function () { console.log(this.table.toString()); diff --git a/benchmarks/encode.js b/benchmarks/encode.js index 06ab956..a1c7d57 100644 --- a/benchmarks/encode.js +++ b/benchmarks/encode.js @@ -1,6 +1,7 @@ var notepack = require('../'); var msgpackJs = require('msgpack-js'); var msgpackNode = require('msgpack'); +var msgpackLite = require('msgpack-lite'); var data = require('./data'); var Benchtable = require('benchtable'); @@ -11,6 +12,9 @@ suite .addFunction('notepack', function (x) { notepack.encode(x); }) +.addFunction('msgpack-lite', function (x) { + msgpackLite.encode(x); +}) .addFunction('msgpack-js', function (x) { msgpackJs.encode(x); }) diff --git a/package.json b/package.json index a9f40ee..efb98bc 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "istanbul": "^0.2.10", "mocha": "^1.18.2", "msgpack": "^0.2.3", - "msgpack-js": "^0.3.0" + "msgpack-js": "^0.3.0", + "msgpack-lite": "^0.1.13" }, "scripts": { "test": "./node_modules/.bin/mocha -r ./test/support/env -R dot ./test",