You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a Version 1 CFRunLoopSource for faster task dispatch
https://bugs.webkit.org/show_bug.cgi?id=202874
Reviewed by Simon Fraser.
Source/WTF:
This performance bottleneck showed up in IndexedDB. We worked around it
by switching to WorkQueueMessageReceiver. Now it's showing up again
in the GPU Process.
* wtf/RunLoop.h: Added a mach port. We use this for wake-up.
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::performWork): Use the standard declaration for a
Version 1 run loop source callback.
(WTF::RunLoop::RunLoop): Use a dummy mach port for wake-ups. The default
wake-up mechanism uses pthread APIs, which cost hundreds of microseconds
per invocation, even on the most modern hardware. In contrast, a mach
message takes about nine microseconds.
(WTF::RunLoop::~RunLoop): Free the mach port.
(WTF::RunLoop::wakeUp): Copy-pasted code to signal a mach port. The
message payload doesn't matter because we're just trying to achieve
a wakeup, kind of like calling a void() function.
Tools:
Fixed a test incompatibiilty.
* TestWebKitAPI/cocoa/UtilitiesCocoa.mm:
(TestWebKitAPI::Util::spinRunLoop): Be sure to run the runloop until
it runs out of sources to handle.
The SuspendServiceWorkerProcessBasedOnClientProcesses test invokes
spinRunLoop while adding items to the runloop. Under those conditions,
whether a given source will fire or not in a single invocation of
CFRunLoopRunInMode is undefined behavior.
Canonical link: https://commits.webkit.org/231841@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
0 commit comments