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 single-threaded runtime in tokio #451

Merged
merged 2 commits into from
Jan 6, 2025
Merged

Conversation

LucasPickering
Copy link
Owner

@LucasPickering LucasPickering commented Jan 6, 2025

Description

Describe the change. If there is an associated issue, please include the issue link (e.g. "Closes #xxx"). For UI changes, please also include screenshots.

Generally there is very low CPU and I/O utilization by Slumber, so there's no benefit in distributing work over multiple tasks. Uses a single thread should cut down on wasted context switches, and also allow for simplifying code by eliminating the need for the mpsc message queue.

Known Risks

What issues could potentially go wrong with this change? Is it a breaking change? What have you done to mitigate any potential risks?

If someone is trying to send a ton of requests at once, it's possible we start to become CPU-bound by the single thread. I think this is very unlikely though. We could always switch back to multi-threading if necessary.

QA

How did you test this?

Manually ran tests and reloaded collection in the TUI

Checklist

  • Have you read CONTRIBUTING.md already?
  • Did you update CHANGELOG.md?
    • Only user-facing changes belong in the changelog. Internal changes such as refactors should only be included if they'll impact users, e.g. via performance improvement.
  • Did you remove all TODOs?
    • If there are unresolved issues, please open a follow-on issue and link to it in a comment so future work can be tracked

Generally there is very low CPU and I/O utilization by Slumber, so there's no benefit in distributing work over multiple tasks. Uses a single thread should cut down on wasted context switches, and also allow for simplifying code by eliminating the need for the mpsc message queue.
@LucasPickering LucasPickering merged commit 00efb23 into 3.0 Jan 6, 2025
15 checks passed
@LucasPickering LucasPickering deleted the local-tasks-only branch January 6, 2025 23:39
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.

1 participant