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

Combine the check and attach loops. #205

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

clalancette
Copy link
Collaborator

This is mostly a performance optimization. We notice that we always attempt to detach the condition, regardless of whether we've attached it to begin with. We can use that to our advantage, in that during the initial iteration to check if something has triggered, we can also attach at the same time. This saves us from having to iterate over the wait set again later on. There is a downside here in that we may end up attaching things that we didn't need, but we also only do that up until something is ready. So this is probably a performance win in the usual cases.

This is mostly a performance optimization.  We notice that
we *always* attempt to detach the condition, regardless of
whether we've attached it to begin with.  We can use that
to our advantage, in that during the initial iteration
to check if something has triggered, we can also attach
at the same time.  This saves us from having to iterate
over the wait set again later on.  There is a downside
here in that we may end up attaching things that we
didn't need, but we also only do that up until something
is ready.  So this is probably a performance win in the
usual cases.

Signed-off-by: Chris Lalancette <[email protected]>
@clalancette clalancette merged commit 543738e into rolling Jun 21, 2024
7 checks passed
@clalancette clalancette deleted the clalancette/combine-check-and-attach branch June 21, 2024 18:58
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