Optimization for 'monit'

Michael Tremer michael.tremer at ipfire.org
Wed Jun 5 09:10:21 BST 2019


Morning :)

> On 5 Jun 2019, at 08:52, Matthias Fischer <matthias.fischer at ipfire.org> wrote:
> 
> Hi,
> 
> could someone please take a look at the '--enable-optimized'-option in
> 'monit'-configure:
> 
> The corresponding code from 'configure' reads:
> 
> ...
> # Check whether --enable-optimized was given.
> if test "${enable_optimized+set}" = set; then :
>  enableval=$enable_optimized;
>        CFLAGS=`echo $CFLAGS|sed 's/-O.//g'`
>        if test "x$enableval" = "xyes" ; then
>                CFLAGS=`echo $CFLAGS|sed 's/-g[^ ]*//g'`
>                CFLAGS=`echo $CFLAGS|sed 's/-O.//g'`
>                CFLAGS="$CFLAGS -O3 -DNDEBUG"
>                OPTIMIZED=1
>        else
>                OPTIMIZED=0
>        fi
> ...
> 
> Since I'm not so good in 'CFGLAG'-options ( ;-) ), I'd like to know what
> this option REALLY does and if we should use it - prior to pushing it to
> GIT.

So this removes all -O options and replaces them with -O3.

That is the highest level of code optimisation in the compiler. It will spend a lot of extra time to find out how to make the code faster. That might all sound desirable, but in reality it does not really help much. The code will grow in size and on computers with smaller caches (i.e. Atom series) the code will perform significantly slower.

We have this enabled for a couple things where the processor spends a lot of time (glib used to be compiled with -O3). Boost uses it by default, because they only care about performance on large systems.

Leave it disabled, please. We use -O2 everywhere.

> Second option would be '--without-ipv6' since I think we do not really
> need this in v2.23.

Not sure if is necessary but we have IPv6 compiled into many things.

> Its running here on Core 131 - compiled with these two options and
> without seen problems - but I just want to be sure.
> 
> What do you think?

See above :)

-Michael

> 
> Best,
> Matthias



More information about the Development mailing list