Bug 185951 - Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
Summary: Some of the work in initializeLogChannelsIfNecessary() is unnecessary for rel...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-24 10:08 PDT by Chris Dumez
Modified: 2018-05-24 12:24 PDT (History)
6 users (show)

See Also:


Attachments
Patch (9.56 KB, patch)
2018-05-24 10:23 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2018-05-24 10:08:30 PDT
Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels should be enabled.
Comment 1 Chris Dumez 2018-05-24 10:17:26 PDT
Sample Count, Samples %, CPU %, Symbol
17, 0.2%, 0.1%, WebKit::InitializeWebKit2() (in WebKit)
17, 0.2%, 0.1%,     std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) (in libc++.1.dylib)
17, 0.2%, 0.1%,         WebKit::runInitializationCode(void*) (in WebKit)
11, 0.1%, 0.1%,             WebCore::initializeLogChannelsIfNecessary(std::optional<WTF::String>) (in WebCore)
6, 0.1%, 0.0%,                 WebCore::logLevelString() (in WebCore)
5, 0.1%, 0.0%,                     +[NSUserDefaults(NSUserDefaults) standardUserDefaults] (in Foundation)
5, 0.1%, 0.0%,                         -[NSUserDefaults(NSUserDefaults) init] (in Foundation)
5, 0.1%, 0.0%,                             +[NSLocale currentLocale] (in CoreFoundation)
1, 0.0%, 0.0%,                     -[NSUserDefaults(NSUserDefaults) stringForKey:] (in Foundation)
5, 0.1%, 0.0%,                 WTFInitializeLogChannelStatesFromString (in JavaScriptCore)
5, 0.1%, 0.0%,                     os_log_create (in libsystem_trace.dylib)
Comment 2 Chris Dumez 2018-05-24 10:23:47 PDT
Created attachment 341204 [details]
Patch
Comment 3 Geoffrey Garen 2018-05-24 11:39:08 PDT
Comment on attachment 341204 [details]
Patch

r=me
Comment 4 WebKit Commit Bot 2018-05-24 12:23:05 PDT
Comment on attachment 341204 [details]
Patch

Clearing flags on attachment: 341204

Committed r232158: <https://trac.webkit.org/changeset/232158>
Comment 5 WebKit Commit Bot 2018-05-24 12:23:07 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-05-24 12:24:21 PDT
<rdar://problem/40530243>