Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
aa6fdf1
benchmark: (arrays) use destructuring
BridgeAR Dec 30, 2017
52cfd34
benchmark: (assert) use destructuring
BridgeAR Dec 30, 2017
a47b478
benchmark: (url) use destructuring
BridgeAR Dec 30, 2017
d6d4b6b
benchmark: (zlib) use destructuring
BridgeAR Dec 30, 2017
e032fee
benchmark: (util/v8/vm) use destructuring
BridgeAR Dec 30, 2017
67d158c
benchmark: (tls) use destructuring
BridgeAR Dec 30, 2017
69e7083
benchmark: (timers) use destructuring
BridgeAR Dec 30, 2017
c84762f
benchmark: (streams) use destructuring
BridgeAR Dec 30, 2017
e841268
benchmark: (querystring) use destructuring
BridgeAR Dec 30, 2017
ae5a06f
benchmark: (process) use destructuring
BridgeAR Dec 30, 2017
15c3b26
benchmark: (net) use destructuring
BridgeAR Dec 30, 2017
8bfa3af
benchmark: (os) use destructuring
BridgeAR Dec 30, 2017
b4609ab
benchmark: (path) use destructuring
BridgeAR Dec 30, 2017
62976e0
benchmark: (string_decoder) use destructuring
BridgeAR Dec 30, 2017
7e0df93
benchmark: (http2) use destructuring
BridgeAR Dec 30, 2017
c56feec
benchmark: (misc) use destructuring
BridgeAR Dec 30, 2017
a0b8fa3
benchmark: (http) use destructuring
BridgeAR Dec 30, 2017
9473627
benchmark: (fs) use destructuring
BridgeAR Dec 30, 2017
c3adef5
benchmark: (es) use destructuring
BridgeAR Dec 30, 2017
7a7ecad
benchmark: (events) use destructuring
BridgeAR Dec 30, 2017
f90cd1d
benchmark: (buffers) use destructuring
BridgeAR Dec 30, 2017
d746d5a
benchmark: (child_process) use destructuring
BridgeAR Dec 30, 2017
171a010
benchmark: (dgram) use destructuring
BridgeAR Dec 30, 2017
3a99ff9
benchmark: use destructuring
BridgeAR Dec 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
benchmark: (fs) use destructuring
PR-URL: #18250
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
BridgeAR committed Jan 23, 2018
commit 9473627e1eafc0e422f746d7ff8b160170d83e8d
4 changes: 1 addition & 3 deletions benchmark/fs/bench-readdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const bench = common.createBenchmark(main, {
});


function main(conf) {
const n = conf.n >>> 0;

function main({ n }) {
bench.start();
(function r(cntr) {
if (cntr-- <= 0)
Expand Down
4 changes: 1 addition & 3 deletions benchmark/fs/bench-readdirSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const bench = common.createBenchmark(main, {
});


function main(conf) {
const n = conf.n >>> 0;

function main({ n }) {
bench.start();
for (var i = 0; i < n; i++) {
fs.readdirSync(path.resolve(__dirname, '../../lib/'));
Expand Down
5 changes: 1 addition & 4 deletions benchmark/fs/bench-realpath.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ const bench = common.createBenchmark(main, {
});


function main(conf) {
const n = conf.n >>> 0;
const pathType = conf.pathType;

function main({ n, pathType }) {
bench.start();
if (pathType === 'relative')
relativePath(n);
Expand Down
5 changes: 1 addition & 4 deletions benchmark/fs/bench-realpathSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ const bench = common.createBenchmark(main, {
});


function main(conf) {
const n = conf.n >>> 0;
const pathType = conf.pathType;

function main({ n, pathType }) {
bench.start();
if (pathType === 'relative')
relativePath(n);
Expand Down
4 changes: 1 addition & 3 deletions benchmark/fs/bench-stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const bench = common.createBenchmark(main, {
});


function main(conf) {
const n = conf.n >>> 0;
const statType = conf.statType;
function main({ n, statType }) {
var arg;
if (statType === 'fstat')
arg = fs.openSync(__filename, 'r');
Expand Down
4 changes: 1 addition & 3 deletions benchmark/fs/bench-statSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const bench = common.createBenchmark(main, {
});


function main(conf) {
const n = conf.n >>> 0;
const statSyncType = conf.statSyncType;
function main({ n, statSyncType }) {
const arg = (statSyncType === 'fstatSync' ?
fs.openSync(__filename, 'r') :
__dirname);
Expand Down
2 changes: 1 addition & 1 deletion benchmark/fs/read-stream-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const bench = common.createBenchmark(main, {

function main(conf) {
encodingType = conf.encodingType;
size = +conf.size;
size = conf.size;
filesize = conf.filesize;

switch (encodingType) {
Expand Down
4 changes: 1 addition & 3 deletions benchmark/fs/readFileSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ const bench = common.createBenchmark(main, {
n: [60e4]
});

function main(conf) {
const n = +conf.n;

function main({ n }) {
bench.start();
for (var i = 0; i < n; ++i)
fs.readFileSync(__filename);
Expand Down
8 changes: 3 additions & 5 deletions benchmark/fs/readfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ const bench = common.createBenchmark(main, {
concurrent: [1, 10]
});

function main(conf) {
const len = +conf.len;
function main({ len, dur, concurrent }) {
try { fs.unlinkSync(filename); } catch (e) {}
var data = Buffer.alloc(len, 'x');
fs.writeFileSync(filename, data);
Expand All @@ -30,7 +29,7 @@ function main(conf) {
bench.end(reads);
try { fs.unlinkSync(filename); } catch (e) {}
process.exit(0);
}, +conf.dur * 1000);
}, dur * 1000);

function read() {
fs.readFile(filename, afterRead);
Expand All @@ -48,6 +47,5 @@ function main(conf) {
read();
}

var cur = +conf.concurrent;
while (cur--) read();
while (concurrent--) read();
}
5 changes: 1 addition & 4 deletions benchmark/fs/write-stream-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ const bench = common.createBenchmark(main, {
size: [2, 1024, 65535, 1024 * 1024]
});

function main(conf) {
const dur = +conf.dur;
const encodingType = conf.encodingType;
const size = +conf.size;
function main({ dur, encodingType, size }) {
var encoding;

var chunk;
Expand Down