Bug 95107 - Split LayoutTypes.h to improve compile time
Summary: Split LayoutTypes.h to improve compile time
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: nbhargava
URL:
Keywords:
Depends on: 95310 95356
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-27 11:23 PDT by nbhargava
Modified: 2013-01-25 15:37 PST (History)
12 users (show)

See Also:


Attachments
Patch (18.88 KB, patch)
2012-08-27 11:26 PDT, nbhargava
no flags Details | Formatted Diff | Diff
Patch (23.20 KB, patch)
2012-08-27 14:23 PDT, nbhargava
no flags Details | Formatted Diff | Diff
Patch (23.08 KB, patch)
2012-08-27 15:34 PDT, nbhargava
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nbhargava 2012-08-27 11:23:57 PDT
Split LayoutTypes.h to improve compile time
Comment 1 nbhargava 2012-08-27 11:26:37 PDT
Created attachment 160755 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-08-27 12:30:36 PDT
Comment on attachment 160755 [details]
Patch

I'm not a huge fan of the new name.  LayoutTypes was already kinda the catch-all for these types.  I might have gone the other way and moved the functions out into a new header.  LayoutTypesInlines.h or similar?  Lets poll eae/smfr (sadly levi is on vacation).
Comment 3 Eric Seidel (no email) 2012-08-27 12:31:14 PDT
Aside from the (to me) awkward naming, the change looks great!
Comment 4 nbhargava 2012-08-27 14:23:25 PDT
Created attachment 160806 [details]
Patch
Comment 5 Eric Seidel (no email) 2012-08-27 14:35:25 PDT
Comment on attachment 160806 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=160806&action=review

Actually, I went to go find other Inlines.h examples for you, and foudn they're all called "*InlineMethods.h"  Seems we should match that pattern here.  (LayoutTypesInlineMethods.h would be the name.)

Again, this is ready for r+, but the misplaced comment seems confusing.  Since we're going one more round for the comment, if you could change the name one more time that would be ideal.  Sorry for the run-around. :(

> Source/WebCore/rendering/LayoutTypesInline.h:34
> +// These typedefs are being used to abstract layout and hit testing off
> +// of integers and eventually replace them with floats. Once this transition
> +// is complete, these types will be removed. Progress can be tracked at
> +// https://bugs.webkit.org/show_bug.cgi?id=60318

This seems misplaced?
Comment 6 Eric Seidel (no email) 2012-08-27 14:35:51 PDT
Once again, I really apprecaite your work on compile times.  They make us all more productive in the end.
Comment 7 Simon Fraser (smfr) 2012-08-27 14:38:32 PDT
Comment on attachment 160806 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=160806&action=review

> Source/WebCore/ChangeLog:10
> +        as many things. (Parts from LayoutTypes.h are expensive to include)

It would be nice to mention which parts.
Comment 8 nbhargava 2012-08-27 15:34:30 PDT
Created attachment 160827 [details]
Patch
Comment 9 Eric Seidel (no email) 2012-08-27 15:36:41 PDT
Comment on attachment 160827 [details]
Patch

LGTM.
Comment 10 WebKit Review Bot 2012-08-27 16:13:33 PDT
Comment on attachment 160827 [details]
Patch

Clearing flags on attachment: 160827

Committed r126816: <http://trac.webkit.org/changeset/126816>
Comment 11 WebKit Review Bot 2012-08-27 16:13:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Alexey Proskuryakov 2012-08-28 09:39:35 PDT
Did you measure how much this improves compile times, or was this based on intuition?
Comment 13 nbhargava 2012-08-28 09:51:51 PDT
A bit of both (though all of my hard measurements are based off of a Chromium build). LayoutTypes and all of its nested #includes take roughly 0.7s to compile. LayoutTypes is included in a lot of high-use header files, such as Node.h, but in reality the only thing that most header files needs from LayoutTypes.h is a declaration of LayoutUnit, LayoutRect, etc.

The inline methods are the only part of LayoutTypes.h that actually need full definitions of what the Layout elements amount to. Eliminating the inclusions of FractionalLayoutRect, FloatRect, etc. from files that didn't need them led to a decrease in aggregate CPU time by 4-5 minutes (so a fully serialized Chromium build would be 5 minutes faster).

I haven't explicitly measured the results on just a WebKit build, but I'd imagine that there would be some similar benefit.
Comment 14 Alexey Proskuryakov 2012-08-28 09:56:14 PDT
Thank you!
Comment 15 WebKit Review Bot 2012-08-29 01:37:12 PDT
Re-opened since this is blocked by 95310
Comment 16 Emil A Eklund 2012-08-29 02:52:17 PDT
Thanks Nikhil! If you have any other ideas of how we can reduce the compile time penalty for LayoutTypes until we remove the abstraction please do tell.
Comment 17 Emil A Eklund 2013-01-25 15:37:57 PST
Marking as invalid as LayoutTypes.h is no more.