Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions benchmarks/decode.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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);
})
Expand All @@ -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());
Expand Down
4 changes: 4 additions & 0 deletions benchmarks/encode.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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);
})
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
"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",
"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",
Expand Down