Optimize after delays on broadcast connections and fix them for C #593
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.
#553 fixed after delays on broadcast connections in C++, but did so quite inefficiently. Given a broadcast connection with N left ports and M right ports (N<=M), #553 would create M delay reactors and broadcast from the left ports to the delay instances. However, it would be much more efficient to only create N delay reactors and broadcast their output to the right ports. This optimization is implemented in this PR. The PR also includes test cases for C and C++.
Interestingly, this change also happens to fix #554. It looks like the C generator expected the broadcast to occur on the right side of the delay reactors. This is probably the reason why #553 did not fix the issue for C.