-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
loadbalancer: better asymptotic behavior of host updates (#2745)
Motivation: Our current host update process is quadratic both in time and space due to searching for hosts using list iteration and performing a COW for each entry of the SD event set. Modifications: Make a Map<Address, SDEvent>. This lets us iterate through existing events with O(M+N) complexity instead of O(M*N) complexity. As a bonus, we can now easily detect if we get multiple SD events for the same address in a batch. Result: We should see slightly worse performance in the small M*N case but dramatically better performance in the large case. Since SD events shouldn't be terribly common and making a hashmap is cheap relative to the total cost of a SD update, this is the safer tradeoff.
- Loading branch information
1 parent
6a18e4d
commit 936e01b
Showing
3 changed files
with
97 additions
and
94 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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