Skip to content

Instantly share code, notes, and snippets.

@JacksonTian
Created April 16, 2015 09:34
Show Gist options
  • Save JacksonTian/f7a663fa83525bba8aeb to your computer and use it in GitHub Desktop.
Save JacksonTian/f7a663fa83525bba8aeb to your computer and use it in GitHub Desktop.
Buffer.concat([])
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite();
suite
.add("new length 0", function () {
Buffer.concat([]);
})
// add listeners
.on('cycle', function (event) {
console.log(String(event.target));
})
.on('complete', function () {
console.log('Fastest is ' + this.filter('fastest').pluck('name'));
})
.run({ async: false });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment