This is great, I've wanted to do this for a while too, but it wasn't
really feasible inside WebKit.
As pointed out in a previous thread ("Stoooooopid questions") we
should probably wait until the code moves to src/blink to avoid
changing all the #include lines twice.
On Mon, Apr 15, 2013 at 9:12 AM, Scott Graham <sco...@chromium.org> wrote:
This is great, I've wanted to do this for a while too, but it wasn't
really feasible inside WebKit.
As pointed out in a previous thread ("Stoooooopid questions") we
should probably wait until the code moves to src/blink to avoid
changing all the #include lines twice.
I don't know that I would wait, as I don't think we have a particular ETA for moving to src/blink.
In theory, moving from unqualified includes ("foo.h") to qualified ("bar/foo.h") is much harder than simply renaming files once they're qualified. I would break the patch apart into a few steps:1) Ensure that we have some common -I dir that all the files have; we probably have this already. This could be src/, src/third_party/WebKit, src/third_party/WebKit/Source (I'm not sure it matters).
2) Modify the scripts to generate headers based off of that. Use a constant in the scripts so that it's easy to change :).3) Modify the source files in batches to use the qualified dir; there's probably no reason they need to all land at once, or even in any particular order
/Daniel
On Mon, Apr 15, 2013 at 9:27 AM, Dirk Pranke <dpr...@chromium.org> wrote:
On Mon, Apr 15, 2013 at 9:12 AM, Scott Graham <sco...@chromium.org> wrote:
This is great, I've wanted to do this for a while too, but it wasn't
really feasible inside WebKit.
As pointed out in a previous thread ("Stoooooopid questions") we
should probably wait until the code moves to src/blink to avoid
changing all the #include lines twice.
I don't know that I would wait, as I don't think we have a particular ETA for moving to src/blink.Yeah, I agree that we shouldn't wait until we move to src/blink.In theory, moving from unqualified includes ("foo.h") to qualified ("bar/foo.h") is much harder than simply renaming files once they're qualified. I would break the patch apart into a few steps:1) Ensure that we have some common -I dir that all the files have; we probably have this already. This could be src/, src/third_party/WebKit, src/third_party/WebKit/Source (I'm not sure it matters).I'd recommend using src/third_party/WebKit/Source as the base of the include directory. Including more directories is just noise at this point.Before we make this change, I would like to move the following directories:A) Source/WebCore -> Source/coreB) Source/WTF/wtf -> Source/wtfAfter we do that, the include paths should look pretty reasonable. For example:#include "wtf/RefPtr.h"#include "core/dom/Document.h"Moving those directories around shouldn't be too hard. I should be able to move those directories by the end of the week, but if someone else is excited about moving code around, feel free to do it before me. ;)
On Mon, Apr 15, 2013 at 9:46 AM, Adam Barth <aba...@chromium.org> wrote:
On Mon, Apr 15, 2013 at 9:27 AM, Dirk Pranke <dpr...@chromium.org> wrote:
On Mon, Apr 15, 2013 at 9:12 AM, Scott Graham <sco...@chromium.org> wrote:
This is great, I've wanted to do this for a while too, but it wasn't
really feasible inside WebKit.
As pointed out in a previous thread ("Stoooooopid questions") we
should probably wait until the code moves to src/blink to avoid
changing all the #include lines twice.
I don't know that I would wait, as I don't think we have a particular ETA for moving to src/blink.Yeah, I agree that we shouldn't wait until we move to src/blink.In theory, moving from unqualified includes ("foo.h") to qualified ("bar/foo.h") is much harder than simply renaming files once they're qualified. I would break the patch apart into a few steps:1) Ensure that we have some common -I dir that all the files have; we probably have this already. This could be src/, src/third_party/WebKit, src/third_party/WebKit/Source (I'm not sure it matters).I'd recommend using src/third_party/WebKit/Source as the base of the include directory. Including more directories is just noise at this point.Before we make this change, I would like to move the following directories:A) Source/WebCore -> Source/coreB) Source/WTF/wtf -> Source/wtfAfter we do that, the include paths should look pretty reasonable. For example:#include "wtf/RefPtr.h"#include "core/dom/Document.h"Moving those directories around shouldn't be too hard. I should be able to move those directories by the end of the week, but if someone else is excited about moving code around, feel free to do it before me. ;)The WTF move is now complete. I'm working on moving WebCore.Daniel, if you like you can start by removing the include directories for wtf and modules now. We can then remove the include paths for WebCore once the move is done.
Would this be the first case where generated files don't wind up under the /out directory?I'm fond of the "when all else fails" cleanup of rm -fr out/ReleaseIs there a risk of cross-pollenation when I generate the files by doing a debug build, and then run a release build in the same checkout?
On Fri, Apr 26, 2013 at 10:54 AM, Thomas Sepez <tse...@google.com> wrote:
Would this be the first case where generated files don't wind up under the /out directory?I'm fond of the "when all else fails" cleanup of rm -fr out/ReleaseIs there a risk of cross-pollenation when I generate the files by doing a debug build, and then run a release build in the same checkout?All of the generated files will be placed in the "out" directory. The question is how the generated files will refer back to non-generated headers. For example, Node.idl generates V8Node.h, which includes Node.h. Somehow V8Node.h will need to know that Node.h is in the "dom" directory.As for including generated headers (e.g., V8Node.h) from non-generated sources, we'll need to add the directory where the generated files are stored to the include path in some form because it's different on different platforms. We might want to place all the generated headers in a subdirectory called "generated" or something so that then can by included as #include "generated/V8Node.h".
Den 2013-05-03 16:24:26 skrev Daniel Bratell <bra...@opera.com>:I think we can declare this mission accomplished.
Den 2013-04-30 08:31:31 skrev Daniel Bratell <bra...@opera.com>:
I'll return when I have more data.
I have more data.
I can verify that the current patch to add paths to generated files (used by the webcore_derived project) has no measurable effect on compilation time (somewhere between 0.0 and 0.5% faster which is less than the time added elsewhere).
It's still not the same compilation speed as what I saw when I originally posted this discussion which means that there is something else to find. I will keep looking.
Big thanks to abarth, thakis, harakan and others who picked this up and made something happen.
Proof in the form of some graphs showing big compilation time improvements in some blink projects:
https://picasaweb.google.com/110337600520532820098/PublicData#5875350723587357794 [1]
webcore_dom -47%
webcore_html -46%
webcore_platform -49%
webcore_rendering -43%
Sadly the numbers will not be the same for everyone. In particular it seems like Google developers (i.e. most Blink developers) have other bottlenecks and will not see as big improvements [2].
But from the rest of us, this is very much appreciated!