[
https://issues.apache.org/jira/browse/MESOS-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14382781#comment-14382781
]
Benjamin Mahler commented on MESOS-2556:
----------------------------------------
Linking in MESOS-1022, which has some relevant discussion. [~benjaminhindman]
had mentioned some of the benefits there and in the original review
[here|http://mail-archives.apache.org/mod_mbox/incubator-mesos-dev/201302.mbox/%[email protected]%3E].
The summary from what I understand is that we are generally ok now with moving
definitions into single compilation units, and we've been doing this within the
mesos source, and a little bit inside the libprocess source. It seems that
C++11 in combination with link time optimization might address
[~benjaminhindman]'s concerns in that ticket.
However, stout is likely to remain header-only for now, given the benefit of
being able to #include the file and be on your way, no need to run a stout
'make' and link.
Of course, we're reasonable people. If moving stout definitions to .cpp files
makes our build _incredibly_ fast, then it may make sense to revisit our
decision. But I think we'll need to drive such a direction-changing decision
with data. :)
So far, we've been slowly moving things into .cpp files within mesos and
libprocess, so you may want to continue that trend and see how much you can
speed up the build. However, we've been doing this without monitoring the
impact on build times or performance, so for all we know, we could have
actually made the build and/or the code slower! ;)
> 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)