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

Optimize strategy defaults #5

Closed
jlizen opened this issue Dec 24, 2024 · 2 comments
Closed

Optimize strategy defaults #5

jlizen opened this issue Dec 24, 2024 · 2 comments

Comments

@jlizen
Copy link
Owner

jlizen commented Dec 24, 2024

Currently we use 'current context' (for non-tokio) and 'spawn_blocking' (for tokio) if the caller doesn't specify a strategy. Both have no concurrency control.

I imagine that spawn blocking might benefit from a default concurrency limit that is the current CPU core count. Maybe that's the default for only non-specified, maybe that's also the default for caller-specified spawn blocking.

And then, current context (as well as block_in_place) you probably don't want to use such a high concurrency limit, since the default is often going to be to have a worker thread per core, so executing in the current context is likely to starve the executor.

Though, at that point, probably we also would need to give guidance on handling the LIFO slot not being stealable.

I'll be doing some light perf testing to validate an initial use case (tokio-rustls + this crate), so will play around with the above behaviors.

@jlizen
Copy link
Owner Author

jlizen commented Dec 26, 2024

Defaults are updated in #9 but still requires testing

@jlizen
Copy link
Owner Author

jlizen commented Dec 30, 2024

Closing as we decided to not implicitly set defaults in general

@jlizen jlizen closed this as completed Dec 30, 2024
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

No branches or pull requests

1 participant