You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Neil Conway <ne...@gmail.com> on 2016/02/18 01:24:52 UTC

Enable compiler optimization by default?

Hi folks,

At present, Mesos defaults to compiling with "-O0"; to enable compiler
optimizations, the user needs to specify "--enable-optimize".

I'd like to propose we change the default, for a few reasons:

(1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g". Anecdotally,
I think most software packages compile with a reasonable level of
optimizations enabled by default.

(2) I think we should make the default configure flags appropriate for
end-users (rather than Mesos developers): developers will be familiar
enough with Mesos to tune the configure flags according to their own
preferences.

(3) The performance consequences of not enabling compiler
optimizations can be pretty severe: 5x in a benchmark I just ran, and
we've seen between 2x and 30x (!) performance differences for some
real-world workloads.

Neil

Re: Enable compiler optimization by default?

Posted by Kevin Klues <kl...@gmail.com>.
+1

On Wed, Feb 17, 2016 at 4:24 PM, Neil Conway <ne...@gmail.com> wrote:
> Hi folks,
>
> At present, Mesos defaults to compiling with "-O0"; to enable compiler
> optimizations, the user needs to specify "--enable-optimize".
>
> I'd like to propose we change the default, for a few reasons:
>
> (1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g". Anecdotally,
> I think most software packages compile with a reasonable level of
> optimizations enabled by default.
>
> (2) I think we should make the default configure flags appropriate for
> end-users (rather than Mesos developers): developers will be familiar
> enough with Mesos to tune the configure flags according to their own
> preferences.
>
> (3) The performance consequences of not enabling compiler
> optimizations can be pretty severe: 5x in a benchmark I just ran, and
> we've seen between 2x and 30x (!) performance differences for some
> real-world workloads.
>
> Neil



-- 
~Kevin

Re: Enable compiler optimization by default?

Posted by Benjamin Mahler <bm...@apache.org>.
I won't -1 but please see below before proceeding.

This was the original behavior and this will bring it full circle :)
See the thread here, and the additional links:

http://markmail.org/thread/ylqbxezgz6rtb7v2
https://reviews.apache.org/r/26426/#comment_rc96919-56878
https://issues.apache.org/jira/browse/MESOS-1985

It would be great to include an understanding of this context along with
the proposal.

On Thu, Feb 18, 2016 at 10:59 AM, Joris Van Remoortere <
joris.van.remoortere@gmail.com> wrote:

> +1 (binding)
> with the condition that we fix the flag mixing problem between CXXFLAGS and
> --enable-optimize --enable-debug, even if it is to disallow it for now.
> I want to avoid surprising behavior with implicit flags such as optimize:
> passing irrelevant CXXFLAGS magically turns it into a debug build.
>
> On Thu, Feb 18, 2016 at 1:27 PM, Neil Conway <ne...@gmail.com>
> wrote:
>
> > Great! I created https://issues.apache.org/jira/browse/MESOS-4709 to
> > track this issue.
> >
> > Neil
> >
> > On Thu, Feb 18, 2016 at 12:43 AM, Jan Schlicht <ja...@mesosphere.io>
> wrote:
> > > +1
> > >
> > > On Thu, Feb 18, 2016 at 2:34 AM, Klaus Ma <kl...@gmail.com>
> > wrote:
> > >
> > >> +1;
> > >>
> > >> So our CI will also update to use optimisation flags, right?  We need
> to
> > >> highlight this in upgrade document to our user; I used to meet so
> > strange
> > >> behaviour after changing -O level.
> > >>
> > >> On Thu, Feb 18, 2016 at 8:51 AM James DeFelice <
> > james.defelice@gmail.com>
> > >> wrote:
> > >>
> > >> > +1
> > >> > On Feb 17, 2016 7:24 PM, "Neil Conway" <ne...@gmail.com>
> wrote:
> > >> >
> > >> > > Hi folks,
> > >> > >
> > >> > > At present, Mesos defaults to compiling with "-O0"; to enable
> > compiler
> > >> > > optimizations, the user needs to specify "--enable-optimize".
> > >> > >
> > >> > > I'd like to propose we change the default, for a few reasons:
> > >> > >
> > >> > > (1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g".
> > Anecdotally,
> > >> > > I think most software packages compile with a reasonable level of
> > >> > > optimizations enabled by default.
> > >> > >
> > >> > > (2) I think we should make the default configure flags appropriate
> > for
> > >> > > end-users (rather than Mesos developers): developers will be
> > familiar
> > >> > > enough with Mesos to tune the configure flags according to their
> own
> > >> > > preferences.
> > >> > >
> > >> > > (3) The performance consequences of not enabling compiler
> > >> > > optimizations can be pretty severe: 5x in a benchmark I just ran,
> > and
> > >> > > we've seen between 2x and 30x (!) performance differences for some
> > >> > > real-world workloads.
> > >> > >
> > >> > > Neil
> > >> > >
> > >> >
> > >> --
> > >>
> > >> Regards,
> > >> ----
> > >> Da (Klaus), Ma (马达), PMP® | Advisory Software Engineer
> > >> IBM Platform Development & Support, STG, IBM GCG
> > >> +86-10-8245 4084 | madaxa@cn.ibm.com | http://k82.me
> > >>
> > >
> > >
> > >
> > > --
> > > *Jan Schlicht*
> > > Distributed Systems Engineer, Mesosphere
> >
>

Re: Enable compiler optimization by default?

Posted by Joris Van Remoortere <jo...@gmail.com>.
+1 (binding)
with the condition that we fix the flag mixing problem between CXXFLAGS and
--enable-optimize --enable-debug, even if it is to disallow it for now.
I want to avoid surprising behavior with implicit flags such as optimize:
passing irrelevant CXXFLAGS magically turns it into a debug build.

On Thu, Feb 18, 2016 at 1:27 PM, Neil Conway <ne...@gmail.com> wrote:

> Great! I created https://issues.apache.org/jira/browse/MESOS-4709 to
> track this issue.
>
> Neil
>
> On Thu, Feb 18, 2016 at 12:43 AM, Jan Schlicht <ja...@mesosphere.io> wrote:
> > +1
> >
> > On Thu, Feb 18, 2016 at 2:34 AM, Klaus Ma <kl...@gmail.com>
> wrote:
> >
> >> +1;
> >>
> >> So our CI will also update to use optimisation flags, right?  We need to
> >> highlight this in upgrade document to our user; I used to meet so
> strange
> >> behaviour after changing -O level.
> >>
> >> On Thu, Feb 18, 2016 at 8:51 AM James DeFelice <
> james.defelice@gmail.com>
> >> wrote:
> >>
> >> > +1
> >> > On Feb 17, 2016 7:24 PM, "Neil Conway" <ne...@gmail.com> wrote:
> >> >
> >> > > Hi folks,
> >> > >
> >> > > At present, Mesos defaults to compiling with "-O0"; to enable
> compiler
> >> > > optimizations, the user needs to specify "--enable-optimize".
> >> > >
> >> > > I'd like to propose we change the default, for a few reasons:
> >> > >
> >> > > (1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g".
> Anecdotally,
> >> > > I think most software packages compile with a reasonable level of
> >> > > optimizations enabled by default.
> >> > >
> >> > > (2) I think we should make the default configure flags appropriate
> for
> >> > > end-users (rather than Mesos developers): developers will be
> familiar
> >> > > enough with Mesos to tune the configure flags according to their own
> >> > > preferences.
> >> > >
> >> > > (3) The performance consequences of not enabling compiler
> >> > > optimizations can be pretty severe: 5x in a benchmark I just ran,
> and
> >> > > we've seen between 2x and 30x (!) performance differences for some
> >> > > real-world workloads.
> >> > >
> >> > > Neil
> >> > >
> >> >
> >> --
> >>
> >> Regards,
> >> ----
> >> Da (Klaus), Ma (马达), PMP® | Advisory Software Engineer
> >> IBM Platform Development & Support, STG, IBM GCG
> >> +86-10-8245 4084 | madaxa@cn.ibm.com | http://k82.me
> >>
> >
> >
> >
> > --
> > *Jan Schlicht*
> > Distributed Systems Engineer, Mesosphere
>

Re: Enable compiler optimization by default?

Posted by Neil Conway <ne...@gmail.com>.
Great! I created https://issues.apache.org/jira/browse/MESOS-4709 to
track this issue.

Neil

On Thu, Feb 18, 2016 at 12:43 AM, Jan Schlicht <ja...@mesosphere.io> wrote:
> +1
>
> On Thu, Feb 18, 2016 at 2:34 AM, Klaus Ma <kl...@gmail.com> wrote:
>
>> +1;
>>
>> So our CI will also update to use optimisation flags, right?  We need to
>> highlight this in upgrade document to our user; I used to meet so strange
>> behaviour after changing -O level.
>>
>> On Thu, Feb 18, 2016 at 8:51 AM James DeFelice <ja...@gmail.com>
>> wrote:
>>
>> > +1
>> > On Feb 17, 2016 7:24 PM, "Neil Conway" <ne...@gmail.com> wrote:
>> >
>> > > Hi folks,
>> > >
>> > > At present, Mesos defaults to compiling with "-O0"; to enable compiler
>> > > optimizations, the user needs to specify "--enable-optimize".
>> > >
>> > > I'd like to propose we change the default, for a few reasons:
>> > >
>> > > (1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g". Anecdotally,
>> > > I think most software packages compile with a reasonable level of
>> > > optimizations enabled by default.
>> > >
>> > > (2) I think we should make the default configure flags appropriate for
>> > > end-users (rather than Mesos developers): developers will be familiar
>> > > enough with Mesos to tune the configure flags according to their own
>> > > preferences.
>> > >
>> > > (3) The performance consequences of not enabling compiler
>> > > optimizations can be pretty severe: 5x in a benchmark I just ran, and
>> > > we've seen between 2x and 30x (!) performance differences for some
>> > > real-world workloads.
>> > >
>> > > Neil
>> > >
>> >
>> --
>>
>> Regards,
>> ----
>> Da (Klaus), Ma (马达), PMP® | Advisory Software Engineer
>> IBM Platform Development & Support, STG, IBM GCG
>> +86-10-8245 4084 | madaxa@cn.ibm.com | http://k82.me
>>
>
>
>
> --
> *Jan Schlicht*
> Distributed Systems Engineer, Mesosphere

Re: Enable compiler optimization by default?

Posted by Jan Schlicht <ja...@mesosphere.io>.
+1

On Thu, Feb 18, 2016 at 2:34 AM, Klaus Ma <kl...@gmail.com> wrote:

> +1;
>
> So our CI will also update to use optimisation flags, right?  We need to
> highlight this in upgrade document to our user; I used to meet so strange
> behaviour after changing -O level.
>
> On Thu, Feb 18, 2016 at 8:51 AM James DeFelice <ja...@gmail.com>
> wrote:
>
> > +1
> > On Feb 17, 2016 7:24 PM, "Neil Conway" <ne...@gmail.com> wrote:
> >
> > > Hi folks,
> > >
> > > At present, Mesos defaults to compiling with "-O0"; to enable compiler
> > > optimizations, the user needs to specify "--enable-optimize".
> > >
> > > I'd like to propose we change the default, for a few reasons:
> > >
> > > (1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g". Anecdotally,
> > > I think most software packages compile with a reasonable level of
> > > optimizations enabled by default.
> > >
> > > (2) I think we should make the default configure flags appropriate for
> > > end-users (rather than Mesos developers): developers will be familiar
> > > enough with Mesos to tune the configure flags according to their own
> > > preferences.
> > >
> > > (3) The performance consequences of not enabling compiler
> > > optimizations can be pretty severe: 5x in a benchmark I just ran, and
> > > we've seen between 2x and 30x (!) performance differences for some
> > > real-world workloads.
> > >
> > > Neil
> > >
> >
> --
>
> Regards,
> ----
> Da (Klaus), Ma (马达), PMP® | Advisory Software Engineer
> IBM Platform Development & Support, STG, IBM GCG
> +86-10-8245 4084 | madaxa@cn.ibm.com | http://k82.me
>



-- 
*Jan Schlicht*
Distributed Systems Engineer, Mesosphere

Re: Enable compiler optimization by default?

Posted by Klaus Ma <kl...@gmail.com>.
+1;

So our CI will also update to use optimisation flags, right?  We need to
highlight this in upgrade document to our user; I used to meet so strange
behaviour after changing -O level.

On Thu, Feb 18, 2016 at 8:51 AM James DeFelice <ja...@gmail.com>
wrote:

> +1
> On Feb 17, 2016 7:24 PM, "Neil Conway" <ne...@gmail.com> wrote:
>
> > Hi folks,
> >
> > At present, Mesos defaults to compiling with "-O0"; to enable compiler
> > optimizations, the user needs to specify "--enable-optimize".
> >
> > I'd like to propose we change the default, for a few reasons:
> >
> > (1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g". Anecdotally,
> > I think most software packages compile with a reasonable level of
> > optimizations enabled by default.
> >
> > (2) I think we should make the default configure flags appropriate for
> > end-users (rather than Mesos developers): developers will be familiar
> > enough with Mesos to tune the configure flags according to their own
> > preferences.
> >
> > (3) The performance consequences of not enabling compiler
> > optimizations can be pretty severe: 5x in a benchmark I just ran, and
> > we've seen between 2x and 30x (!) performance differences for some
> > real-world workloads.
> >
> > Neil
> >
>
-- 

Regards,
----
Da (Klaus), Ma (马达), PMP® | Advisory Software Engineer
IBM Platform Development & Support, STG, IBM GCG
+86-10-8245 4084 | madaxa@cn.ibm.com | http://k82.me

Re: Enable compiler optimization by default?

Posted by James DeFelice <ja...@gmail.com>.
+1
On Feb 17, 2016 7:24 PM, "Neil Conway" <ne...@gmail.com> wrote:

> Hi folks,
>
> At present, Mesos defaults to compiling with "-O0"; to enable compiler
> optimizations, the user needs to specify "--enable-optimize".
>
> I'd like to propose we change the default, for a few reasons:
>
> (1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g". Anecdotally,
> I think most software packages compile with a reasonable level of
> optimizations enabled by default.
>
> (2) I think we should make the default configure flags appropriate for
> end-users (rather than Mesos developers): developers will be familiar
> enough with Mesos to tune the configure flags according to their own
> preferences.
>
> (3) The performance consequences of not enabling compiler
> optimizations can be pretty severe: 5x in a benchmark I just ran, and
> we've seen between 2x and 30x (!) performance differences for some
> real-world workloads.
>
> Neil
>

Re: Enable compiler optimization by default?

Posted by Neil Conway <ne...@gmail.com>.
On Wed, Feb 17, 2016 at 5:07 PM, Zameer Manji <zm...@apache.org> wrote:
> Can't this problem also be solved by distributing packages that have
> optimized binaries?

The individuals/organizations that build packaged versions of Mesos
should ensure that compiler optimizations are enabled -- but I don't
think this entirely solves the problem, as some portion of users will
use the source tarballs distributed by the Mesos project.

Neil

Re: Enable compiler optimization by default?

Posted by Zameer Manji <zm...@apache.org>.
+1

Can't this problem also be solved by distributing packages that have
optimized binaries?

On Wed, Feb 17, 2016 at 4:56 PM, Alexander Rojas <al...@mesosphere.io>
wrote:

> +1
>
> Since the old days users are used to run
>
> ```
> configure
> make
> sudo make install
> ```
>
> and things just work. With the model we have, we are just encouraging
> users to run their data centers with unoptimized versions of Mesos, which
> just hurts their performance.
>
>
> > On 17 Feb 2016, at 16:24, Neil Conway <ne...@gmail.com> wrote:
> >
> > Hi folks,
> >
> > At present, Mesos defaults to compiling with "-O0"; to enable compiler
> > optimizations, the user needs to specify "--enable-optimize".
> >
> > I'd like to propose we change the default, for a few reasons:
> >
> > (1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g". Anecdotally,
> > I think most software packages compile with a reasonable level of
> > optimizations enabled by default.
> >
> > (2) I think we should make the default configure flags appropriate for
> > end-users (rather than Mesos developers): developers will be familiar
> > enough with Mesos to tune the configure flags according to their own
> > preferences.
> >
> > (3) The performance consequences of not enabling compiler
> > optimizations can be pretty severe: 5x in a benchmark I just ran, and
> > we've seen between 2x and 30x (!) performance differences for some
> > real-world workloads.
> >
> > Neil
>
> --
> Zameer Manji
>
>

Re: Enable compiler optimization by default?

Posted by Avinash Sridharan <av...@mesosphere.io>.
+1

Since most of our debugging is using logs rather than GDB, don't see the
point of not having these optimization flags turned on by default.

On Wed, Feb 17, 2016 at 4:56 PM, Alexander Rojas <al...@mesosphere.io>
wrote:

> +1
>
> Since the old days users are used to run
>
> ```
> configure
> make
> sudo make install
> ```
>
> and things just work. With the model we have, we are just encouraging
> users to run their data centers with unoptimized versions of Mesos, which
> just hurts their performance.
>
>
> > On 17 Feb 2016, at 16:24, Neil Conway <ne...@gmail.com> wrote:
> >
> > Hi folks,
> >
> > At present, Mesos defaults to compiling with "-O0"; to enable compiler
> > optimizations, the user needs to specify "--enable-optimize".
> >
> > I'd like to propose we change the default, for a few reasons:
> >
> > (1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g". Anecdotally,
> > I think most software packages compile with a reasonable level of
> > optimizations enabled by default.
> >
> > (2) I think we should make the default configure flags appropriate for
> > end-users (rather than Mesos developers): developers will be familiar
> > enough with Mesos to tune the configure flags according to their own
> > preferences.
> >
> > (3) The performance consequences of not enabling compiler
> > optimizations can be pretty severe: 5x in a benchmark I just ran, and
> > we've seen between 2x and 30x (!) performance differences for some
> > real-world workloads.
> >
> > Neil
>
>


-- 
Avinash Sridharan, Mesosphere
+1 (323) 702 5245

Re: Enable compiler optimization by default?

Posted by Alexander Rojas <al...@mesosphere.io>.
+1

Since the old days users are used to run

```
configure
make
sudo make install
```

and things just work. With the model we have, we are just encouraging users to run their data centers with unoptimized versions of Mesos, which just hurts their performance.


> On 17 Feb 2016, at 16:24, Neil Conway <ne...@gmail.com> wrote:
> 
> Hi folks,
> 
> At present, Mesos defaults to compiling with "-O0"; to enable compiler
> optimizations, the user needs to specify "--enable-optimize".
> 
> I'd like to propose we change the default, for a few reasons:
> 
> (1) The autoconf default for CFLAGS/CXXFLAGS is "-O2 -g". Anecdotally,
> I think most software packages compile with a reasonable level of
> optimizations enabled by default.
> 
> (2) I think we should make the default configure flags appropriate for
> end-users (rather than Mesos developers): developers will be familiar
> enough with Mesos to tune the configure flags according to their own
> preferences.
> 
> (3) The performance consequences of not enabling compiler
> optimizations can be pretty severe: 5x in a benchmark I just ran, and
> we've seen between 2x and 30x (!) performance differences for some
> real-world workloads.
> 
> Neil