Skip to content

Commit

Permalink
Enhanced benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Ron Korving committed Jan 12, 2017
1 parent 9e0f1c1 commit 9bf0cfc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function createClient() {

var i = 0;
var count = 20000;
var small = 'h'.repeat(2500);
var small = 'h'.repeat(1000);
var big = 'h'.repeat(25000);
var bigRandom = require('crypto').randomBytes(20000).toString('base64');

Expand All @@ -34,6 +34,14 @@ function log(str, label, i, n, cb) {
if (i === n) {
client.close(function () {
console.timeEnd(label + ' x' + n);

console.log('Sent:', client.sent, '- Compressed:', client.compressed);
console.log('');

if (client.sent !== n) {
throw new Error('Should have sent: ' + n);
}

cb();
});

Expand Down

0 comments on commit 9bf0cfc

Please sign in to comment.