Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: concurrency mode #77

Merged
merged 7 commits into from
Apr 21, 2024
Merged

feat: concurrency mode #77

merged 7 commits into from
Apr 21, 2024

Conversation

Aslemammad
Copy link
Member

@Aslemammad Aslemammad commented Apr 15, 2024

Resolves #76

By default runConcurrently runs the different tasks concurrently at the same time! But runConcurrently(number, "task") would run the iterations of each task concurrently at the same time!

Concurrency

  • When mode is set to null (default), concurrency is disabled.
  • When mode is set to 'task', each task's iterations (calls of a task function) run concurrently.
  • When mode is set to 'bench', different tasks within the bench run concurrently
// options way (recommended)
bench.threshold = 10 // The maximum number of concurrent tasks to run. Defaults to Infinity.
bench.concurrency = "task" // The concurrency mode to determine how tasks are run.  
// await bench.warmup()
await bench.run()

// standalone method way
await bench.runConcurrently(10, "task") // with runConcurrently, mode is set to 'bench' by default

Copy link

github-actions bot commented Apr 15, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
dist/index.js 3.36 KB (+29.68% 🔺) 68 ms (+29.68% 🔺) 16 ms (+581.34% 🔺) 83 ms
dist/index.cjs 3.61 KB (+27.08% 🔺) 73 ms (+27.08% 🔺) 19 ms (+324.61% 🔺) 91 ms

@Aslemammad Aslemammad changed the title feat: levels for concurrency feat: concurrency mode Apr 15, 2024
@Aslemammad Aslemammad added the fund Polar.sh funding label Apr 15, 2024
@Aslemammad Aslemammad merged commit 86866ab into main Apr 21, 2024
5 checks passed
@Aslemammad Aslemammad deleted the feat/concurrently-task branch April 21, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fund Polar.sh funding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runConcurrently should run one "task" at a time
1 participant