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(s2n-quic-core): add task cooldown module #1862

Merged
merged 2 commits into from
Aug 11, 2023
Merged

Conversation

camshaft
Copy link
Contributor

@camshaft camshaft commented Jul 6, 2023

Description of changes:

This changes adds an experimental hybrid polling mode that allows for busy polling by self-waking a task for a configurable number of iterations rather than registering a waker and waiting for the other side to call .wake(). This can improve latency in high-throughput scenarios by avoiding the relatively expensive operation of waking up another thread. After the iteration limit is reached, the task registers the waker as normal. This avoids the need to do busy polling the whole time where we don't have a burst of computation to perform.

Call-outs:

This is experimental at the moment so we can kick the tires on it and show it working in actual environments. If the improvement doesn't translate there, it'll be removed instead.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@camshaft camshaft force-pushed the camshaft/hybrid-poll branch 3 times, most recently from 5ee8ee9 to e49116c Compare July 13, 2023 23:41
@camshaft camshaft force-pushed the camshaft/hybrid-poll branch 2 times, most recently from cbddba9 to 0b43134 Compare July 27, 2023 22:43
@camshaft camshaft force-pushed the camshaft/hybrid-poll branch 2 times, most recently from 72d9a60 to fe15338 Compare August 9, 2023 20:50
@camshaft camshaft marked this pull request as ready for review August 10, 2023 17:55
use super::*;

#[test]
fn cooldown_test() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a test that uses Cooldown::new(0), since that's how customers not using the unstable feature would end up using it?

@camshaft camshaft merged commit 2b5cb23 into main Aug 11, 2023
129 checks passed
@camshaft camshaft deleted the camshaft/hybrid-poll branch August 11, 2023 18:17
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