Hooray wrote:So, I tested this. I did get an increase in frame rate (+15) - when building fg from scratch with
- Code: Select all
make CXXFLAGS="-march=native -msse -msse2 -O3 -pipe" -j 4
But I only rebuilt fgfs, not osg and simgear - At some point, I will try this, too. To see if it makes any significant difference or not...
However, personally I still prefer a debug binary with debug symbols and without any optimizations.
Ah, thanks. I also tried this with simgear/flightgear and got a significant improvement on my quite old machine (+10fps).
However, I also added "-Wall" to see all warnings. It's wise to use this when optimizing, since the compiler can sometimes detect if the sources break certain rules required for optimization.
The good news is: simgear is really clean (a single warning in a test program only...).
FlightGear also looks quite good - but unfortunately there are several warnings. It's mainly violations of "strict aliasing", e.g. a whole load in the multiplayer module. In fact, these warnings are already a potential problem when compiling with the FG standard "-O2" (which includes "-fstrict-aliasing") - so this is not good. And "-O3" is even more likely to break things here...
And some more problems show up which are completely unrelated to optimization - such as (potential) usage of uninitialized variables. Indeed, some of them look bad...
Well, I guess these issues should be discussed on the mailing list. But, just be warned when optimizing - doesn't seem to be completely safe right now...
cheers,
ThorstenB (D-TB7)