From 1a323ec8d4e493177e6e4ace995357d86b7016a2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 15 Feb 2022 14:47:32 +0100 Subject: [PATCH] LibCore: Exit get_next_timer_expiration() sooner if possible If we find a timer that needs to be fired immediately, we can stop looking through the remaining timers. This significantly reduces time spent in get_next_timer_expiration() on ACID3. Of course, with a better data structure, we could reduce time spent further. I've left a FIXME about that. --- Userland/Libraries/LibCore/EventLoop.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp index 42734be04d..ed755ceeb6 100644 --- a/Userland/Libraries/LibCore/EventLoop.cpp +++ b/Userland/Libraries/LibCore/EventLoop.cpp @@ -793,6 +793,7 @@ void EventLoopTimer::reload(const Time& now) Optional