[ 
https://issues.apache.org/jira/browse/MESOS-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14382896#comment-14382896
 ] 

Cody Maloney commented on MESOS-2556:
-------------------------------------

Splitting mesos bits into header + cpp file probably is actually making the 
build slower because so much is in the stout headers which needs to be 
recompiled into every .cpp. The savings from not compiling the little bit of 
mesos twice is outweighed by the cost of compiling large swaths of stout 
another time. Only a couple files in mesos would help significantly last I 
looked (Namely <master/flags.hpp> and <slave/flags.hpp> if I recall correctly). 
[~jvanremoortere] and I fixed the biggest ones we could find without making 
stout not header-only.

At the moment the single change which would make the biggest compile time 
improvement would be making <stout/hashmap.hpp> use <unordered_map> instead of 
boost now that exists on all our compilers (Unfortunately that is a massive 
patch because of some hash functions the boost variant picks up which the 
standard one doesn't...).

When I last did measurement, there were a couple of files in stout where this 
would make a massive improvement (stout/strings, stout/os), because they lose a 
whole bunch of other stout they also include, a __ton__ of C system headers and 
C++ standard library headers (Including iostream costs a lot in compile time). 
That all ends up greatly reducing the amount of code parsed / compiled, and 
greatly reduces the amount of linking work done (Some of those functions end up 
showing up in practically every object file in the mesos build and the linker 
then has to spend a ton of time de-duplicating them. Almost all the time a 
linker spends currently is de-duplicating symbols).

For round-trip compile (Clean directory -> full mesos), un-bundling the 
dependencies helps significantly. (And would make it easier for us to upgrade 
to new versions of boost, glog, gest without bloating repository size).

> Consider extracting non-template classes from stout.
> ----------------------------------------------------
>
>                 Key: MESOS-2556
>                 URL: https://issues.apache.org/jira/browse/MESOS-2556
>             Project: Mesos
>          Issue Type: Improvement
>          Components: stout
>            Reporter: Alexander Rukletsov
>
> Stout is a header-only library, but we have some heavy non-template types (in 
> order to comply with ODR, methods of those types are marked inlined): 
> {{Duration}}, {{Flags}}, {{Path}}, {{JSON::Ptotobuf}} and so on. This affects 
> compile time without giving any benefits.
> Possible solutions include
> * migrating such types to {{libprocess}} or {{mesos}},
> * make stout non header-only.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to