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

[ntcore] Optimize scan of outgoing messages #5227

Merged
merged 4 commits into from
Mar 25, 2023

Conversation

PeterJohnson
Copy link
Member

The algorithm being used for scanning outgoing messages was O(n^2) because it did a full linear search and then appended. This scan is performed for each client. If there is a burst of outgoing changes, the outgoing queue can get quite deep all at once and this scan can be very slow. Replacing with a map fixes this.

The algorithm being used for scanning outgoing messages was O(n^2)
because it did a full linear search and then appended. This scan is
performed for each client. If there is a burst of outgoing changes, the
outgoing queue can get quite deep all at once and this scan can be very
slow. Replacing with a map fixes this.
@PeterJohnson PeterJohnson requested a review from a team as a code owner March 22, 2023 05:24
@PeterJohnson PeterJohnson merged commit 0a66479 into wpilibsuite:main Mar 25, 2023
@PeterJohnson PeterJohnson deleted the nt-optimize-outgoing branch March 25, 2023 22:20
This pull request was closed.
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