Fixed nontermination issue in par operators#2239
Merged
Merged
Conversation
vasilmkd
reviewed
Aug 16, 2021
Member
|
Another annoyance I just thought of is the fact that |
Member
Author
|
Oh that's a good point. I'll think about how to resolve that. |
Member
Author
|
Btw given the priority of this fix, I think we shouldn't hold it for the side channel fix. Let's file that and fix in a follow up. |
Member
|
Yup, I'm just waiting for the CI. |
vasilmkd
approved these changes
Aug 16, 2021
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2238
This is a relatively high-priority fix, tbh, since
paroperations could be non-terminating in 3.2.2 with the current implementation. The performance impact is pretty real though:Before:
After
So about 7.5% slower in a naively relative comparison. A better comparison is to look at the overhead costs by measuring relative to an idealized
traverse. I have 16 physical threads, meaning that an (impossible) idealized overhead-freeparTraverseimplementation would get about 3784.368 ops/sec on the first run and 3801.104 ops/sec on the second. The actual throughput was 644.762 and 596.967, respectively, meaning the overhead accounts for 83.0% of the runtime before this change and 84.3% after, which is an increase of about 1.6%. That's unfortunate (also it sucks that the overhead is so high), but it's generally within the bounds of sanity.In theory, an alternative implementation using two
Deferreds (one for each fiber) andguaranteeCasewithin the body of each fiber would probably be slightly faster, but it would also require some more complex dynamic dispatch machinery similar to the original proposal in #2155. It's probably worth measuring that alternative implementation to see if it's a meaningful improvement.