[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-edu-devel
Subject:    Re: marble hard-coding -O3 optimizations
From:       Rex Dieter <rdieter () math ! unl ! edu>
Date:       2012-02-06 17:35:15
Message-ID: jgp30q$a6e$1 () dough ! gmane ! org
[Download RAW message or body]

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

["marble-4.8.0-opt.patch" (text/x-patch)]

diff -up marble-4.8.0/src/CMakeLists.txt.opt marble-4.8.0/src/CMakeLists.txt
--- marble-4.8.0/src/CMakeLists.txt.opt	2011-12-20 13:19:11.000000000 -0600
+++ marble-4.8.0/src/CMakeLists.txt	2012-02-03 20:33:12.895703342 -0600
@@ -91,10 +91,8 @@ ENDMACRO (QT4_ADD_RESOURCES2)
 ENDIF(MINGW)
 
 if (QTONLY)
-  # ce: don't know why this is needed here - on win32 
-  # 'O2' is activated by default in release mode
   if(NOT WIN32)
-    add_definitions (${QT_DEFINITIONS} -O3)
+    add_definitions (${QT_DEFINITIONS})
   endif(NOT WIN32)
 
   include_directories(
@@ -102,7 +100,7 @@ if (QTONLY)
   )
 else (QTONLY)
   if(NOT WIN32)
-    add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -O3) 
+    add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) 
   endif(NOT WIN32)
 
   include_directories(
diff -up marble-4.8.0/src/lib/CMakeLists.txt.opt marble-4.8.0/src/lib/CMakeLists.txt
--- marble-4.8.0/src/lib/CMakeLists.txt.opt	2011-12-20 13:19:11.000000000 -0600
+++ marble-4.8.0/src/lib/CMakeLists.txt	2012-02-03 20:33:40.822354206 -0600
@@ -31,9 +31,8 @@ set(GENERIC_LIB_VERSION "0.13.0")
 set(GENERIC_LIB_SOVERSION "13")
 
 if (QTONLY)
-  # ce: don't know why this is needed here - on win32 'O2' is activated by default in release mode
   if(NOT WIN32)
-    add_definitions (${QT_DEFINITIONS} -O3)
+    add_definitions (${QT_DEFINITIONS})
   endif(NOT WIN32)
 
   include_directories(
@@ -41,7 +40,7 @@ if (QTONLY)
   )
 else (QTONLY)
   if(NOT WIN32)
-    add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -O3)
+    add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
   endif(NOT WIN32)
 
   include_directories(
diff -up marble-4.8.0/tests/CMakeLists.txt.opt marble-4.8.0/tests/CMakeLists.txt
--- marble-4.8.0/tests/CMakeLists.txt.opt	2011-12-20 13:19:11.000000000 -0600
+++ marble-4.8.0/tests/CMakeLists.txt	2012-02-03 20:32:54.705930743 -0600
@@ -71,10 +71,8 @@ endif( CMAKE_COMMAND AND CMAKE_CTEST_COM
 
 # GeoPolygon test
 if (QTONLY)
-  # ce: don't know why this is needed here - on win32 
-  # 'O2' is activated by default in release mode
   if(NOT WIN32)
-    add_definitions (${QT_DEFINITIONS} -O3)
+    add_definitions (${QT_DEFINITIONS})
   endif(NOT WIN32)
 
   include_directories(
@@ -82,7 +80,7 @@ if (QTONLY)
   )
 else (QTONLY)
   if(NOT WIN32)
-    add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -O3) 
+    add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) 
   endif(NOT WIN32)
 
   include_directories(



_______________________________________________
kde-edu mailing list
kde-edu@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic