We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ff400e commit c976446Copy full SHA for c976446
benchmark/fs/bench-glob.js
@@ -11,21 +11,21 @@ const configs = {
11
n: [1e3],
12
dir: ['lib', 'test/parallel', 'benchmark'],
13
pattern: ['**/*', '*.js', '**/**.js'],
14
- useAsync: [true, false],
15
- recursive: [true, false],
+ mode: ['async', 'sync'],
+ recursive: ['true', 'false'],
16
};
17
18
const bench = common.createBenchmark(main, configs);
19
20
async function main(config) {
21
const fullPath = path.resolve(benchmarkDirectory, config.dir);
22
- const { pattern, recursive, useAsync } = config;
+ const { pattern, recursive, mode } = config;
23
24
let noDead;
25
bench.start();
26
27
for (let i = 0; i < config.n; i++) {
28
- if (useAsync) {
+ if (mode === 'async') {
29
noDead = await new Promise((resolve, reject) => {
30
fs.glob(pattern, { cwd: fullPath, recursive }, (err, files) => {
31
if (err) {
0 commit comments