From c37fd28572247c10cf7008946d67c562df70ba85 Mon Sep 17 00:00:00 2001 From: lkn Date: Wed, 24 Jun 2026 19:15:31 +0200 Subject: [PATCH] perf: reduce event loop timeout to 4ms, remove polling schedule_frame The 16ms dispatch timeout added up to 16ms of input latency. 4ms reduces this to ~4ms maximum. Removing unconditional wlr_output_schedule_frame from the main loop stops flooding the swapchain. The output frame callback in handle_output_frame drives rendering at vsync naturally. --- src/backend/wayland/wl_backend.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index ab7ff2a..15d030a 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -1141,11 +1141,7 @@ wl_event_loop_run(void) wl_display_flush_clients(wl_state.display); extern void W_WLClientDispatchPending(void); W_WLClientDispatchPending(); - wl_event_loop_dispatch(loop, 16); - /* Schedule frame AFTER dispatch so the frame event on the next - * iteration renders content from commits processed above. */ - if (wl_state.output) - wlr_output_schedule_frame(wl_state.output); + wl_event_loop_dispatch(loop, 4); /* Check inotify for defaults database changes */ #ifdef HAVE_INOTIFY