Skip to content

Commit

Permalink
bench: Buffer creation
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 19, 2013
1 parent cc38528 commit 419607e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
6 changes: 0 additions & 6 deletions benchmark/buffer_creation.js

This file was deleted.

17 changes: 17 additions & 0 deletions benchmark/buffers/buffer_creation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SlowBuffer = require('buffer').SlowBuffer;

var common = require('../common.js');
var bench = common.createBenchmark(main, {
len: [10, 1024],
n: [1024]
});

function main(conf) {
var len = +conf.len;
var n = +conf.n;
bench.start();
for (var i = 0; i < n * 1024; i++) {
b = new SlowBuffer(len);
}
bench.end(n);
}

0 comments on commit 419607e

Please sign in to comment.