Skip to content

Instantly share code, notes, and snippets.

@aqrln
Created July 28, 2017 03:03
Show Gist options
  • Save aqrln/195743d38f632b5b9a8d5944f30cb6af to your computer and use it in GitHub Desktop.
Save aqrln/195743d38f632b5b9a8d5944f30cb6af to your computer and use it in GitHub Desktop.
benchmark/util/*
'use strict';
const common = require('../common');
const util = require('util');
const bench = common.createBenchmark(main, {
n: [1000],
len: [1e5]
});
function main(conf) {
const arr = new Array(conf.len).fill(0);
bench.start();
for (let i = 0; i < conf.n; i++) {
util.inspect(arr);
}
bench.end(conf.n);
}
'use strict';
const common = require('../common');
const util = require('util');
const bench = common.createBenchmark(main, {
n: [1000],
len: [1e5]
});
function main(conf) {
const arr = new Array(conf.len);
bench.start();
for (let i = 0; i < conf.n; i++) {
util.inspect(arr);
}
bench.end(conf.n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment