Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4565e660a939035ba49bffe5fa4770ec0dffc076
https://github.com/WebKit/WebKit/commit/4565e660a939035ba49bffe5fa4770ec0dffc076
Author: Ryosuke Niwa <[email protected]>
Date: 2024-11-14 (Thu, 14 Nov 2024)
Changed paths:
M Source/WebCore/dom/IdleCallbackController.cpp
M Source/WebCore/dom/IdleCallbackController.h
Log Message:
-----------
Google search page renders 16% slower when enabling requestIdleCallback
https://bugs.webkit.org/show_bug.cgi?id=283145
Reviewed by Chris Dumez.
requestIdleCallback specification's steps to start an idle period specifies that
we must queue a task to invoke the idle callbacks algorithm:
https://w3c.github.io/requestidlecallback/#start-an-idle-period-algorithm
In practice, this has an effect of delaying the idle callbacks to be processed
by
one event loop cycle. Because the steps to invoke idle callbacks algorithm exits
early when there are a higher priority tasks and queues a new task before
invoking
the next idle callback in the list of runnable idle callbacks, this has an
effect
of significantly reducing the chance of idle callbacks being invoked. On
google.com
search results, this has an effect of delaying the first meaningful paint time
by 16%.
This PR improves this situation by having
IdleCallbackController::startIdlePeriod
directly invoke idle callbacks until we run out of time. This dramatically
increases
the chance of idle callbacks running between other tasks & timers and fixes the
page
load time regression on google.com.
* Source/WebCore/dom/IdleCallbackController.cpp:
(WebCore::IdleCallbackController::queueIdleCallback):
(WebCore::IdleCallbackController::startIdlePeriod):
(WebCore::IdleCallbackController::queueTaskToInvokeIdleCallbacks):
(WebCore::IdleCallbackController::invokeIdleCallbacks):
(WebCore::IdleCallbackController::queueTaskToStartIdlePeriod): Deleted.
* Source/WebCore/dom/IdleCallbackController.h:
Canonical link: https://commits.webkit.org/286631@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes