diff options
author | Igor <igorwwwwwwwwwwwwwwwwwwww@users.noreply.github.com> | 2021-03-25 15:16:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-25 07:16:03 -0700 |
commit | cf0a909e2df02f7f17e173f3cae473f6df7bdff2 (patch) | |
tree | 3af6c2b67bdd4fc414f6306dea01c6fc92326e88 /src/blocked.c | |
parent | 1976acfe3e40ca2a1b42ffe7f94cfc7487aa2302 (diff) | |
download | redis-cf0a909e2df02f7f17e173f3cae473f6df7bdff2.tar.gz |
Introduce fast path to bypass expensive serveClientsBlockedOnKeyByModule call (#8689)
Introduce fast path to bypass expensive serveClientsBlockedOnKeyByModule call
Diffstat (limited to 'src/blocked.c')
-rw-r--r-- | src/blocked.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/blocked.c b/src/blocked.c index 5f4fa9ec2..179bf3556 100644 --- a/src/blocked.c +++ b/src/blocked.c @@ -480,6 +480,10 @@ void serveClientsBlockedOnStreamKey(robj *o, readyList *rl) { void serveClientsBlockedOnKeyByModule(readyList *rl) { dictEntry *de; + /* Optimization: If no clients are in type BLOCKED_MODULE, + * we can skip this loop. */ + if (!server.blocked_clients_by_type[BLOCKED_MODULE]) return; + /* We serve clients in the same order they blocked for * this key, from the first blocked to the last. */ de = dictFind(rl->db->blocking_keys,rl->key); |