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

Reduce goroutine overhead by abstracting away the process of goroutine procurement. #1

Open
jordanhasgul opened this issue Jul 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jordanhasgul
Copy link
Owner

Currently, fallible functions are executed in a new goroutine when (*errgroup.Group).Go is called. This creates some overhead when running a large number of fallible functions as we have to pay the price of creating a new goroutine each time.

Instead, we could abstract away the procurement of goroutines as we only care that our fallible function is executed in another goroutine - it does not necessarily need to be a new one. This way, we could allow the consumer to choose whether they would like to execute a fallible function in a new goroutine or have it executed by a single goroutine from a pool of existing goroutines.

@jordanhasgul jordanhasgul added the enhancement New feature or request label Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant