Using version 1 CFRunloopSource for faster task dispatch
authorsihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2019 22:05:24 +0000 (22:05 +0000)
committersihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2019 22:05:24 +0000 (22:05 +0000)
commit6819286a3fa59bdbb3274e8a3e07ae5e9b7fba3f
tree437072c84a352f2fc1804a7a25dc0483c22dca94
parentd48389a7d73f8de06ece0f98782c0aaadd69a842
Using version 1 CFRunloopSource for faster task dispatch
https://bugs.webkit.org/show_bug.cgi?id=202874

Reviewed by Geoffrey Garen.

Source/WTF:

We used CFRunLoopWakeUp to wake up runloop to process source, which seems to be slow according to profiling. To
avoid calling CFRunLoopWakeUp, we should use version 1 CFRunloopSource instead of version 0. This patch brings
about 15% speedup for test PerformanceTests/IndexedDB/basic/objectstore-get.html.

* wtf/RunLoop.cpp:
(WTF::RunLoop::initializeWebRunLoop):
(WTF::RunLoop::web):
* wtf/RunLoop.h:
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::performWork):
(WTF::RunLoop::RunLoop):
(WTF::RunLoop::~RunLoop):
(WTF::RunLoop::wakeUp):
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::initializeWebThread):
(-[JSWTFMainThreadCaller call]): Deleted.

Tools:

Fix a flaky test.

* TestWebKitAPI/Tests/WebKit/getUserMedia.html:

LayoutTests:

Fix a flaky test.

* inspector/css/pseudo-creation-expected.txt:
* inspector/css/pseudo-creation.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/css/pseudo-creation-expected.txt
LayoutTests/inspector/css/pseudo-creation.html
Source/WTF/ChangeLog
Source/WTF/wtf/RunLoop.cpp
Source/WTF/wtf/RunLoop.h
Source/WTF/wtf/cf/RunLoopCF.cpp
Source/WTF/wtf/cocoa/MainThreadCocoa.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit/getUserMedia.html