Re: [AD] DJGPP build

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Bogdan <robotzel@xxxxxxxxxx> wrote:

> 1.
>   Someone said once (on this list) that '-O2' optimizes more than '-O3'.
>   The GCC documentattion states: "`-O3' turns on all optimizations
specified by
>  `-O2' and also turns on the `inline-functions' option."
>   I'm using -O3 to compile Allegro,and this makes the demo and many
>  examples run faster.Also,the library and some executables are
>  smaller,probably because sometimes the function-call overhead is
>  larger than the actual function code,and with '-O3' it is elliminated.
>   IMHO '-O3' should be used in the makefile.

you can't expect me to put back -O3 unless you have very good reasons for
it. some numbers from gprof for most of the library that proves that it
really makes a difference would do it. -O3 turns on all the 'expensive'
optimalizations, those who takes a lot of time to run. there is no need for
automatic inlining since allegro does that manually for functions that are
small enough to be inlined or otherwise makes the program faster by beeing
inlined. -O2 turns on almost every single optimalization there is in gcc and
makes the library compile considerably faster. the only important -O3
optimalization that made a difference was loop unrolling so i have enabled
that via the -funroll-loops parameter. note: after changing -m486
to -mpentium i personally can feel the speed difference. i guess this is
because predictation and speculation works better and other pentium niceness
are beeing exploited. all in all i think the default optimalizations is as
good as they can be for the moment and i'd rather add a new optimalization
pass via -f<whatever> than putting back -O3.

> 2.
>   The executables size (for make compress) can be further reduced by
>  using 'upx --best'.

again numbers please... how much difference does this do in terms of
decompression speed and executable size?

-henrik




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/