[Webkit-unassigned] [Bug 162966] New: [GTK] Curb dependency header inclusions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 5 04:09:54 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=162966

            Bug ID: 162966
           Summary: [GTK] Curb dependency header inclusions
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zan at falconsigh.net

Created attachment 290704
  --> https://bugs.webkit.org/attachment.cgi?id=290704&action=review
WIP

During the hackfest I got pissed off at my computer taking a geological period in duration to compile WebKit. Focusing on one specific file, I dug in.

JSNavigator.cpp.o was the file I chose. It's created through the JS bindings generator, and at first I thought "it's just bindings code being large". There's more to it than that.

On the current system it takes ~5.2 seconds for Clang 3.8 to compile just that one file. Profiling the compiler didn't show much, so that was abandoned.

Looking at the dependencies for this one file though -- the list is staggering. A lot of included headers come from the standard C++ library, and a lot of the headers come from JavaScriptCore. A lot of them also come from our dependencies though -- 242 from libglib, 50 from libsoup. In total that's 292 headers out of the 1090 dependencies for this build target -- a build target that shouldn't depend on platform-specific APIs.

A small patch that removes GUniquePtrSoup.h inclusion from URL.h helps a lot in this case -- JSNavigator.cpp.o depends on 297 headers less than before. The speedup is also noticeable, it drops from ~5.2 seconds to ~4. There's 2453 build targets which include URL.h, but the improvement might not scale as simply as "we'll save 2453 seconds in total compilation time".

So the idea is to see how far this can be curbed. GUniquePtr.h and GUniquePtrSoup.h seem the biggest culprits since they include <libsoup/soup.h> and <gio/gio.h>, respectively. Some stuff can be forward-declared, which can avoid header includes, _except_ SoupBuffer which is defined in the libsoup headers.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161005/9f17205e/attachment.html>


More information about the webkit-unassigned mailing list