Reduce the recompile time of nsLayoutUtils.h
Categories
(Core :: Layout, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: botond, Assigned: botond)
References
Details
Attachments
(6 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Recompiling after a change to nsLayoutUtils.h takes a very long time. I'd like to see if we can reduce that somewhat by including it in fewer places.
Assignee | ||
Comment 1•4 years ago
|
||
This patch covers thw low-hanging fruit: headers that either don't use
nsLayoutUtils.h at all, or where only method implementations that can
easily be moved to the .cpp file use it.
Assignee | ||
Comment 2•4 years ago
|
||
The only thing in nsIFrame.h that was using it was the implementation
of a templated method, which could be moved to nsIFrameInlines.h.
Depends on D91504
Assignee | ||
Comment 3•4 years ago
|
||
nsContainerFrame.h was only using the enum nsLayoutUtils::IntrinsicISizeType,
which this patch moves to LayoutConstants.h instead.
Depends on D91505
Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7c645b39dd1d Avoid including nsLayoutUtils.h from various headers. r=kats https://hg.mozilla.org/integration/autoland/rev/d45caf044f0f Avoid including nsLayoutUtils.h in nsIFrame.h. r=emilio https://hg.mozilla.org/integration/autoland/rev/cb8232ebe212 Avoid including nsLayoutUtils.h in nsContainerFrame.h. r=emilio
Comment 6•4 years ago
|
||
bugherder |
Assignee | ||
Comment 7•4 years ago
|
||
It does not appear to be needed.
Assignee | ||
Comment 8•4 years ago
|
||
Along with a dependent struct DirectDrawInfo.
This allows nsImageRenderer.h and CanvasRenderingContext2D.h to
avoid including nsLayoutUtils.h.
For nsImageRenderer.h in particular, a forward declaration is
not sufficient as nsImageRenderer stores SurfaceFromElementResult
by value.
A couple of method definitions elsewhere are moved out of line
to keep things compiling without including nsLayoutUtils.h in
additional headers.
Depends on D91683
Assignee | ||
Comment 9•4 years ago
|
||
This allows it to be forward-declared (while a nested class cannot be),
such that headers files that use RectCallback by pointer or reference
do not need to include nsLayoutUtils.h.
This avoids including nsLayoutUtils.h in nsRange.h.
Depends on D91684
Assignee | ||
Comment 10•4 years ago
|
||
With these patches in place, nsLayoutUtils.h is no longer included by any header files, with two exceptions:
- nsIFrameInlines.h, which contains a template method definition that uses nsLayoutUtils and therefore cannot be moved into a .cpp file
- however, this is much less widely included than nsIFrame.h (indeed, this is the purpose of the nsIFrameInlines.h header)
- InspectorUtils.h, which is only included by two .cpp files
The patches reduce the recompile time after modifying nsLayoutUtils.h on my local machine from 725s to 237s, a 67% reduction.
Assignee | ||
Updated•4 years ago
|
Comment 11•4 years ago
|
||
Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b6c8e8cdd6ba Avoid including nsLayoutUtils.h in WebGLContext.h. r=jgilbert https://hg.mozilla.org/integration/autoland/rev/ccb08a922676 Move nsLayoutUtils::SurfaceFromElementResult to its own file. r=emilio https://hg.mozilla.org/integration/autoland/rev/adf38a6442cf Move nsLayoutUtils::RectCallback to namespace scope. r=emilio,jgilbert
Comment 12•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b6c8e8cdd6ba
https://hg.mozilla.org/mozilla-central/rev/ccb08a922676
https://hg.mozilla.org/mozilla-central/rev/adf38a6442cf
Description
•