Skip to content

Add --concurrency flag#37

Merged
sindresorhus merged 5 commits intosindresorhus:mainfrom
jopemachine:add-concurrency-option
Mar 11, 2022
Merged

Add --concurrency flag#37
sindresorhus merged 5 commits intosindresorhus:mainfrom
jopemachine:add-concurrency-option

Conversation

@jopemachine
Copy link
Copy Markdown
Contributor

@jopemachine jopemachine commented Mar 10, 2022

Fixes #21.

I'm not sure I need to write test codes about this flag, so I tried to simply benchmark the option using hyperfine.

os.cpus().length on my local computer is 16.

Here are the benchmark results.

$ hyperfine --runs 10 'node ./cli.js ./node_modules ./abc_node_modules' > result1
Benchmark 1: node ./cli.js ./node_modules ./abc_node_modules
  Time (mean ± σ):      5.029 s ±  0.919 s    [User: 5.521 s, System: 5.258 s]
  Range (min … max):    3.665 s …  6.315 s    10 runs
$ hyperfine --runs 10 'node ./cli.js ./node_modules ./abc_node_modules --concurrency=4' > result2
Benchmark 1: node ./cli.js ./node_modules ./abc_node_modules --concurrency=4
  Time (mean ± σ):      5.739 s ±  1.223 s    [User: 6.431 s, System: 5.027 s]
  Range (min … max):    4.451 s …  7.475 s    10 runs

If I need to do other things, I appreciate your letting me know.

@sindresorhus sindresorhus changed the title Add support for concurrency option Add --concurrency flag Mar 11, 2022
@sindresorhus sindresorhus merged commit 8726315 into sindresorhus:main Mar 11, 2022
@sindresorhus
Copy link
Copy Markdown
Owner

Looks good. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for concurrency option

2 participants