# HG changeset patch # User Kim Alvefur # Date 1593534708 -7200 # Node ID df3ee12acd8cfd278854cab204e701de5a8857c1 # Parent aa85cb5b859fd24f55cac700290e271ee8198e08 net.server_epoll: Add setting for turning off callback protections Might improve (CPU) performance at the risk of triggering top level errors. diff -r aa85cb5b859f -r df3ee12acd8c net/server_epoll.lua --- a/net/server_epoll.lua Tue Jun 30 17:35:07 2020 +0200 +++ b/net/server_epoll.lua Tue Jun 30 18:31:48 2020 +0200 @@ -74,6 +74,9 @@ -- Whether to kill connections in case of callback errors. fatal_errors = false; + -- Or disable protection (like server_select) for potential performance gains + protect_listeners = true; + -- Attempt writes instantly opportunistic_writes = false; }}; @@ -192,6 +195,9 @@ self:noise("Missing listener 'on%s'", what); -- uncomment for development and debugging return; end + if not cfg.protect_listeners then + return listener(self, ...); + end local onerror = self.listeners.onerror or traceback; local ok, err = xpcall(listener, onerror, self, ...); if not ok then