WebKit Bugzilla
Attachment 357845 Details for
Bug 192943
: Moving non-critical initializations to a parallel thread can speed up process launch time by 15%.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192943-20181220115247.patch (text/plain), 5.18 KB, created by
Suresh Koppisetty
on 2018-12-20 11:52:48 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Suresh Koppisetty
Created:
2018-12-20 11:52:48 PST
Size:
5.18 KB
patch
obsolete
>Subversion Revision: 239457 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index c813612d50edff8f23239c0474b923a720666348..b93df0f8d5d2dea1bca1eb9f6b8e294122e4310e 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,54 @@ >+2018-12-20 Suresh Koppisetty <skoppisetty@apple.com> >+ >+ Moving non-critical initializations to a parallel thread can speed up process launch time by 15%. >+ https://bugs.webkit.org/show_bug.cgi?id=192943 >+ <rdar://problem/46877677>. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ _RegisterApplication, _LSSetApplicationInformationItem and _accessibilityInitialize are non-critical work >+ and they can be done in a parallel thread to speed up process launch time. Following times are measured >+ from artraces captured under different scenarios. See <rdar://problem/46877677>. >+ >+ System Config: >+ âââââââââââââ >+ MacBook Pro (13-inch, Late 2013 model running 18E158) >+ >+ Clean system: >+ âââââââââââââ >+ Mean total process launch time: 166.56 ms >+ Mean Process Launch time: 58.88 ms >+ Mean Init New Web Process time: 74.64 ms >+ >+ Root with a clean trunk: >+ âââââââââââââ >+ Safari : 32656d6f >+ Webkit: r239297 >+ >+ Mean total process launch time: 176.53 ms >+ Mean Process Launch time: 62.72 ms >+ Mean Init New Web Process time: 83.6 ms >+ >+ Root with proposed changes on top of trunk: >+ âââââââââââââ >+ Safari : 32656d6f >+ Webkit: r239297 >+ >+ Mean total process launch time: 150.12 ms >+ Mean Process Launch time: 64.19 ms >+ Mean Init New Web Process time: 74.18 ms >+ >+ Perf Improvement: >+ âââââââââââââ >+ 176.53 - 150.12 = 26.41 ms (~15%) >+ >+ * WebProcess/WebProcess.h: >+ * WebProcess/cocoa/WebProcessCocoa.mm: >+ (WebKit::WebProcess::platformInitializeWebProcess): >+ (WebKit::WebProcess::updateProcessName): >+ (WebKit::WebProcess::platformInitializeProcess): >+ (WebKit::WebProcess::platformTerminate): >+ > 2018-12-20 Keith Rollin <krollin@apple.com> > > Improve release-level page-load logging >diff --git a/Source/WebKit/WebProcess/WebProcess.h b/Source/WebKit/WebProcess/WebProcess.h >index ad7d1d11367858639353a422d0d3f2ff20dc77f3..231823d628566ef91d144e22d688efc5654a8c80 100644 >--- a/Source/WebKit/WebProcess/WebProcess.h >+++ b/Source/WebKit/WebProcess/WebProcess.h >@@ -468,6 +468,7 @@ private: > #if PLATFORM(MAC) > std::unique_ptr<WebCore::CPUMonitor> m_cpuMonitor; > Optional<double> m_cpuLimit; >+ dispatch_queue_t m_internalQueue; > > enum class ProcessType { Inspector, ServiceWorker, PrewarmedWebContent, WebContent }; > ProcessType m_processType { ProcessType::WebContent }; >diff --git a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >index ef32528f6899cffda85207b7ad76a0c2d2fde6f1..56941a3e53d880c6e0b879730b03772cb98e638d 100644 >--- a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >+++ b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >@@ -185,7 +185,9 @@ void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& par > #if PLATFORM(MAC) && ENABLE(WEBPROCESS_NSRUNLOOP) > // Need to initialize accessibility for VoiceOver to work when the WebContent process is using NSRunLoop. > // Currently, it is also needed to allocate and initialize an NSApplication object. >- [NSApplication _accessibilityInitialize]; >+ dispatch_async(m_internalQueue, ^{ >+ [NSApplication _accessibilityInitialize]; >+ }); > #endif > > #if TARGET_OS_IPHONE >@@ -235,7 +237,7 @@ void WebProcess::updateProcessName() > break; > } > >- dispatch_async(dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0), ^{ >+ dispatch_async(m_internalQueue, ^{ > // Note that it is important for _RegisterApplication() to have been called before setting the display name. > auto error = _LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), _kLSDisplayNameKey, (CFStringRef)applicationName, nullptr); > ASSERT(!error); >@@ -362,9 +364,11 @@ void WebProcess::platformInitializeProcess(const ChildProcessInitializationParam > > SwitchingGPUClient::setSingleton(WebSwitchingGPUClient::singleton()); > >- // This is necessary so that we are able to set the process' display name. >- _RegisterApplication(nullptr, nullptr); >- >+ m_internalQueue = dispatch_queue_create([NSString stringWithFormat:@"com.apple.WebKit.WebProcessCocoa"].UTF8String, DISPATCH_QUEUE_SERIAL); >+ dispatch_async(m_internalQueue, ^{ >+ // This is necessary so that we are able to set the process' display name. >+ _RegisterApplication(nullptr, nullptr); >+ }); > #else > > if (![NSApp isRunning]) { >@@ -413,6 +417,9 @@ void WebProcess::stopRunLoop() > void WebProcess::platformTerminate() > { > AVFoundationMIMETypeCache::singleton().setCacheMIMETypesCallback(nullptr); >+#if PLATFORM(MAC) >+ dispatch_release(m_internalQueue); >+#endif > } > > RetainPtr<CFDataRef> WebProcess::sourceApplicationAuditData() const
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192943
:
357845
|
357860
|
357870
|
357902
|
357915