Skip to content

Instantly share code, notes, and snippets.

@mbroadst
Created March 18, 2015 01:18
Show Gist options
  • Save mbroadst/833ece981fdd118a99e2 to your computer and use it in GitHub Desktop.
Save mbroadst/833ece981fdd118a99e2 to your computer and use it in GitHub Desktop.
var Benchmark = require('benchmark');
// this outputs nothing
new Benchmark.Suite()
.add("TestBuffer", {
'setup': function() {
this.buffer = new Buffer();
},
'fn': function() {
console.log(this.buffer);
}
})
.run();
// this outputs tons of integers
new Benchmark.Suite()
.add("TestInt", {
'setup': function() {
this.value = 10;
},
'fn': function() {
console.log(this.value);
}
})
.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment