-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize linear search of WAIT and WAITAOF when unblocking the client (…
…#787) Currently, if the client enters a blocked state, it will be added to the server.clients_waiting_acks list. When the client is unblocked, that is, when unblockClient is called, we will need to linearly traverse server.clients_waiting_acks to delete the client, and this search is O(N). When WAIT (or WAITAOF) is used extensively in some cases, this O(N) search may be time-consuming. We can remember the list node and store it in the blockingState struct and it can avoid the linear search in unblockClientWaitingReplicas. Signed-off-by: Binbin <binloveplay1314@qq.com>
- Loading branch information
1 parent
a2f4aed
commit 4d93ef0
Showing
3 changed files
with
18 additions
and
8 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