Software /
code /
prosody
Changeset
13336:f91761822420
net.server_epoll: Avoid call to update socket watch flags when nothing changed
Should skip a syscall for each write when using epoll.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 21 Nov 2023 22:06:28 +0100 |
parents | 13335:8b3bf0d2ffd4 |
children | 13337:5e258164d214 |
files | net/server_epoll.lua |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/net/server_epoll.lua Tue Nov 21 20:45:56 2023 +0100 +++ b/net/server_epoll.lua Tue Nov 21 22:06:28 2023 +0100 @@ -400,6 +400,9 @@ end if r == nil then r = self._wantread; end if w == nil then w = self._wantwrite; end + if r == self._wantread and w == self._wantwrite then + return true + end local ok, err, errno = poll:set(fd, r, w); if not ok then self:debug("Could not update poller state: %s(%d)", err, errno);