marble hard-coding -O3 optimizations

Rex Dieter rdieter at math.unl.edu
Mon Feb 6 17:35:15 UTC 2012


Rex Dieter wrote:

> Torsten Rahn wrote:
> 
>> However for Marble it's a different case: It can reduce the framerate
>> hugely if you compile with Debug mode - last time I checked it was about
>> half the speed or less. I don't want to hear people complaining about
>> speed just because they use packages that are possibly compiled with
>> Debug flags or because they compile it themselves with the Debug flag and
>> are unaware of the impact.
>> 
>> That's why this solution is in place. So far it has worked well for us.
>> And I wouldn't like to "fix" it unless there is a real problem. :-)
> 
> It's a problem because -O3 overrides what is specified by the
> builder/packager too.  No other core kde app does this, that I'm aware of.
> 
> I don't know about other packagers or distros, but mine has some
> relatively strict guidelines and policies I need to follow wrt
> complilation flags... and I'd rather not to have to patch this for
> eternity.
> 
> For what it's worth, I just discovered this in FindKDE4Internal.cmake:
...
>    set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-

So torsten and I had chatted a bit on irc, and he made the case that -O3 is 
desirable too (over just -O2).  At one time, -O3 apparently did make a 
significant enough difference to make using it worthwhile.

What's "worthwhile" you say?  Basically, we want some objective measure of 
performance, and one easy way was to configure marble to use fullscreen 
globe projection with Atlas map theme, and run it with:
marble --fps --timedemo
comparing builds with and without the -O3 hard-coded.

In my own quick-n-dirty tests on my oldish dell latitude d620 laptop (i945 
graphics) on fedora 16 x86_64 with qt-4.8.0/kdeedu-4.8.0, I saw:
-O3:   Timedemo finished in 5667ms "= 35.2858 fps" 
default ReleaseWithDebInfo: Timedemo finished in 5856ms "= 34.153 fps"
a difference of slightly over 1 fps.

Attached is the patch I used to remove the -O3 flag.  I'll try to find more 
machines to test and get a larger pool of benchmarks.

-- rex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marble-4.8.0-opt.patch
Type: text/x-patch
Size: 2454 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20120206/6526798f/attachment.patch>


More information about the kde-edu mailing list