Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Add NullStream; use it for MsgPack benchmarking.
  • Loading branch information
pgriess committed Aug 24, 2010
1 parent 5ee6e94 commit d97757f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/msgpack/bench.js
Expand Up @@ -71,10 +71,10 @@ var TYPE_CBS = [

// pack
(function() {
var b = new Buffer(1024);
var s = new util.NullStream();

return function() {
strtokMsgpack.packBuf(b, 0, OBJ_TEMPLATE);
strtokMsgpack.packStream(s, OBJ_TEMPLATE);
};
})(),

Expand Down
9 changes: 9 additions & 0 deletions test/util.js
Expand Up @@ -90,6 +90,15 @@ var SinkStream = function(bufSz) {
};
exports.SinkStream = SinkStream;

var NullStream = function() {
var self = this;

self.write = function() {
return true;
};
};
exports.NullStream = NullStream;

// Run the given stream (or string, coverted into a SourceStream) through
// strtok,parse() and verify types that come back using the given state
// table.
Expand Down

0 comments on commit d97757f

Please sign in to comment.