Diff

net/server_epoll.lua @ 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
parent 12974:ba409c67353b
child 13422:3c80124452ed
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);