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

Use Task.Run to better parallelize tasks #2

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Conversation

paulirwin
Copy link
Member

The prior code would run tasks sequentially up until the first await, this should better parallelize the tasks by invoking them with Task.Run.

This also moves from using ValueTask to using Task, as there is no ValueTask.Run equivalent. This was also probably a premature optimization.

In order to not have to repeat the Task.Run in each strategy, this change makes the strategy return a list of delegates rather than a list of Tasks, and the runner then invokes the delegate via Task.Run.

@paulirwin paulirwin requested a review from jamesmblair August 7, 2024 00:07
@jamesmblair jamesmblair merged commit a29aaa0 into main Aug 7, 2024
@paulirwin paulirwin deleted the bugfix/task-run branch August 8, 2024 22:20
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.

2 participants