Bug 107333

Summary: [CMake] Build webcore using cmake's object library feature
Product: WebKit Reporter: holo
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED    
Severity: Normal CC: d-r, gyuyoung.kim, laszlo.gombos, mxie, paroga, rakuco, rwlbuis, tmpsantos, tonikitoo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library
Attachments:
Description Flags
patch none

holo
Reported 2013-01-18 15:27:47 PST
Created attachment 183558 [details] patch The proposed patch utilizes cmake's object library feature introduced in 2.8.8. This patch provides the option for users to compile WebCore source files into object files but does not link archive or link them into a library file. Instead the object files may be included in other targets created by add_library or add_executable by listing the object library as a source with special syntax $<TARGET_OBJECTS:objlib>, where "objlib" is the object library name (which in this case is webkit). By doing this, webcore avoids having to link and thus reducing webkit build time in general.
Attachments
patch (5.27 KB, patch)
2013-01-18 15:27 PST, holo
no flags
Thiago Marcos P. Santos
Comment 1 2013-01-20 22:03:00 PST
(In reply to comment #0) > Created an attachment (id=183558) [details] > patch > > The proposed patch utilizes cmake's object library feature introduced in 2.8.8. This patch provides the option for users to compile WebCore source files into object files but does not link archive or link them into a library file. Instead the object files may be included in other targets created by add_library or add_executable by listing the object library as a source with special syntax $<TARGET_OBJECTS:objlib>, where "objlib" is the object library name (which in this case is webkit). > > By doing this, webcore avoids having to link and thus reducing webkit build time in general. The problem of bumping CMake's version is that most of the EFL developers are using Ubuntu 12.04 on theirs development machine (and on our bots) and it ships CMake 2.8.7. The reason being because it is the latest LTS (Long Term Support) release. That said, I cannot support this change.
Dominik Röttsches (drott)
Comment 2 2013-01-21 09:31:37 PST
Comment on attachment 183558 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=183558&action=review > CMakeLists.txt:115 > +SET(USE_WEBCORE_OBJECTS 0) Maybe you can set this depending on the CMAKE version and keep the syntax compatible with older versions?
Dominik Röttsches (drott)
Comment 3 2013-01-21 09:32:18 PST
(In reply to comment #0) > By doing this, webcore avoids having to link and thus reducing webkit build time in general. Do you have some figures of the impact?
holo
Comment 4 2013-01-21 09:35:38 PST
In terms of stats: Building the blackberry port of webkit, I've seen an average of a 4 minute decrease in build time. Granted I am building on an SSD, linking times in general are shorted.
holo
Comment 5 2013-01-21 09:58:11 PST
To elaborate on my previous comment, it generally takes 15 minutes or more to build webkit on average. Now it take 11 minutes.
Thiago Marcos P. Santos
Comment 6 2013-01-23 06:41:47 PST
(In reply to comment #5) > To elaborate on my previous comment, it generally takes 15 minutes or more to build webkit on average. Now it take 11 minutes. Are you comparing it against building WebKit using SHARED_CORE?
Thiago Marcos P. Santos
Comment 7 2013-01-23 07:18:51 PST
I'm going to clarify my points and concerns here. When measuring performance of a buildsystem, what I'm most concerned is the performance from the developers perspective. It is good if we can save time on the bots, but not if the tradeoff affects the developers routine. If I understood the proposed change correctly, we are not going to link WebCore anymore as a single object to relink it again when linking the ultimate target: libwebkit.so. Instead, we are going to get a handful of shared objects. When developing a feature for say, WebKit2 API, I usually build as the follows: webkit-efl/WebKitBuild/Debug$ make ewebkit2/fast Which will build WebKit2 API only and link it against libwebcore. It takes 2 seconds on my machine in average. It wont be possible anymore because there will be no libwebcore to link against. Currently our final target is the sum of: webkit2 + javascriptcore + webcore + wtf. If we don't link webcore, people working on any of these components will always have to link it in order to test their changes.
Raphael Kubo da Costa (:rakuco)
Comment 8 2013-01-23 07:29:42 PST
(In reply to comment #7) > If I understood the proposed change correctly, we are not going to link WebCore anymore as a single object to relink it again when linking the ultimate target: libwebkit.so. Instead, we are going to get a handful of shared objects. Just one small correction: this change does not generate a handful of shared objects (.so files), but rather only generate the object files (.o) without linking them together into a .a file at the end.
Thiago Marcos P. Santos
Comment 9 2013-01-23 07:32:52 PST
(In reply to comment #8) > (In reply to comment #7) > > If I understood the proposed change correctly, we are not going to link WebCore anymore as a single object to relink it again when linking the ultimate target: libwebkit.so. Instead, we are going to get a handful of shared objects. > > Just one small correction: this change does not generate a handful of shared objects (.so files), but rather only generate the object files (.o) without linking them together into a .a file at the end. Thanks, that's what i meant.
holo
Comment 10 2013-01-23 07:50:00 PST
(In reply to comment #6) > (In reply to comment #5) > > To elaborate on my previous comment, it generally takes 15 minutes or more to build webkit on average. Now it take 11 minutes. > > Are you comparing it against building WebKit using SHARED_CORE? No, I am comparing it against building WebKit with default options
holo
Comment 11 2013-01-23 09:02:12 PST
From looking at webcore's CMakeLists.txt, I see linking is done in TARGET_LINK_LIBRARIES(${WebCore_LIBRARY_NAME} ${WebCore_LIBRARIES}) What if I moved ${WebCore_LIBRARIES} to link with webkit? would that fix this issue?
Note You need to log in before you can comment on or make changes to this bug.