Julian Foad writes:

 > I experimented with the effect of inlining on code size and compile
 > times (but not run-time performance) on the src/FDM/JSBSim tree
 > within FlightGear CVS as of about a week ago.  I did this by
 > supplying different compiler options with "make
 > CFLAGS=... CXXFLAGS=...".

 > Code size:
 >            seconds    bytes  options
 > Smallest:    203     761360  -g -O1 -finline-limit-6 -finline-functions
 > Smallest O2: 233     767064  -g -O2 -finline-limit-6 -finline-functions
 > Default:     388    1328284  -g -O2
 > Largest:     388    1328284  -g -O2

This morning, I rebuilt both SimGear and FlightGear completely, with
CFLAGS and CXXFLAGS set to 

  -g -O1 -finline-limit=6 -finline-functions

Here is the size of the old binary (using -O2):

   text    data     bss     dec     hex filename
3097230  500980 3121944 6720154  668a9a /usr/local/FlightGear/bin/fgfs

Here is the size of the new binary (using -O1 etc.):

   text    data     bss     dec     hex filename
2484117  690300 3121976 6296393  601349 /usr/local/src/FlightGear/src/Main/fgfs

The size saving is not all that dramatic: the old binary had
text+data=3598210, while the new binary has text+data=3174417,
resulting in about a 12% size saving.  Compilation time felt much
faster, but I didn't actually time it.

I ran a few quick framerate tests, both on the ground and in the air,
without panel or hud, in external and pilot view.  The framerates for
both binaries are always within 1fps of each other, so cutting out
most of the inlining makes no measurable difference, positive or
negative.  If other people's tests show the same result, then I
suggest that we switch the default CXXFLAGS and CFLAGS, if only for
the sake of faster compiles and a slightly smaller executable.


All the best,


David

-- 
David Megginson
[EMAIL PROTECTED]


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to