diff options
Diffstat (limited to 'benchmark/fs/bench-readdirSync.js')
-rw-r--r-- | benchmark/fs/bench-readdirSync.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/benchmark/fs/bench-readdirSync.js b/benchmark/fs/bench-readdirSync.js index ef3327163e..5d0e97399a 100644 --- a/benchmark/fs/bench-readdirSync.js +++ b/benchmark/fs/bench-readdirSync.js @@ -5,14 +5,18 @@ const fs = require('fs'); const path = require('path'); const bench = common.createBenchmark(main, { - n: [1e4], + n: [10], + dir: [ 'lib', 'test/parallel'], + withFileTypes: ['true', 'false'] }); -function main({ n }) { +function main({ n, dir, withFileTypes }) { + withFileTypes = withFileTypes === 'true'; + const fullPath = path.resolve(__dirname, '../../', dir); bench.start(); for (var i = 0; i < n; i++) { - fs.readdirSync(path.resolve(__dirname, '../../lib/')); + fs.readdirSync(fullPath, { withFileTypes }); } bench.end(n); } |