Avoid unnecessary send_replace calls in seqwait (#9852)

The notifications need to be sent whenever the waiters heap changes, per
the comment in `update_status`. But if 'advance' is called when there
are no waiters, or the new LSN is lower than the waiters so that no one
needs to be woken up, there's no need to send notifications. This saves
some CPU cycles in the common case that there are no waiters.
This commit is contained in:
Heikki Linnakangas
2024-11-22 15:29:49 +02:00
committed by GitHub
parent d9de65ee8f
commit 7372312a73

View File

@@ -83,7 +83,9 @@ where
}
wake_these.push(self.heap.pop().unwrap().wake_channel);
}
self.update_status();
if !wake_these.is_empty() {
self.update_status();
}
wake_these
}