Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
The Best CFLAGS for SPEED
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
psihodelia
n00b
n00b


Joined: 27 Dec 2006
Posts: 15

PostPosted: Wed May 23, 2007 7:26 pm    Post subject: The Best CFLAGS for SPEED Reply with quote

Hello Guys,

I have some questions:
can you please tell me

1) what optimization flags for gcc are the best? Installation time is unimportant for me, what really has a meaning is SPEED!
I have currently
Code:
CFLAGS="-O2 -mcpu=G4 -mtune=G4 -maltivec -mabi=altivec -fno-strict-aliasing -pipe"

and Quake3 shows very good FPS. My small iBook G4 with 1200 MhZ CPU is sometimes even faster than Athlon 1333 but much more silent and cool. I haved Radeon 9200 GPU with 32 Mb.

2) is there an option to use another compiler (not gcc) to install some software? I know that GCC is the best compiler ever, but it should be interesting to try compile say mplayer with another compiler.

3) one annoying thing is loading time for all applications. I dont understand why having so good CPU it takes so long time to load any program into the RAM. Maybe prelink should help with it ? Has you tried it on PPC?

4) other annoying thing is slow interactivity in Firefox. If I am trying to switch between tabs, a firefox reaction time is slow.


Thanks in advance!
Code:

ibook tmp # cat /proc/cpuinfo
processor       : 0
cpu             : 7447A, altivec supported
clock           : 1199.999997MHz
revision        : 0.2 (pvr 8003 0102)
bogomips        : 36.73
timebase        : 18432000
platform        : PowerMac
machine         : PowerBook6,5
motherboard     : PowerBook6,5 MacRISC3 Power Macintosh
detected as     : 287 (iBook G4)
pmac flags      : 0000001b
L2 cache        : 512K unified
pmac-generation : NewWorld


Last edited by psihodelia on Thu May 24, 2007 3:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
ndansmith
n00b
n00b


Joined: 01 Aug 2005
Posts: 60

PostPosted: Wed May 23, 2007 9:53 pm    Post subject: Reply with quote

FWIW Here is the link to the GCC 4.1.2 manual chapter on optimization:
http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Optimize-Options.html#Optimize-Options

:D That's all I can contribute.
Back to top
View user's profile Send private message
veonline
n00b
n00b


Joined: 21 Mar 2005
Posts: 58

PostPosted: Thu May 24, 2007 8:28 am    Post subject: Reply with quote

thanks ndansmith for the interesting resource, but... 8O it's a jungle of intricated and obscure gcc voodoo!!
it's true that most of the optimizations are handled well by the various -OX flags, but for shure must be something interesting out there in that jungle... ffor those who can, shoot out some signalling rocket!

@psihodelia
for the question n1, your flags should be right if you're seeking execution speed, but, question n3, you may try with -Os in order to reduce the loading time.
for the question n4, you should look into your kernel config if is enabled the preempion and wich type, maybe you could also think about wich kernel version do you uses, i.e. vanilla, gentoo, ck, mm... there are a lot out there (quite another jungle and obscure voodoo)
about the question n2, i think you should try install another compiler and select it via gcc-config just before the emerging of the package
_________________
abbasso uindovs!!!
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Fri May 25, 2007 2:21 am    Post subject: Reply with quote

Building with --as-needed (as described here: http://www.gentoo.org/proj/en/qa/asneeded.xml ) can help to improve startup times, but not all packages work with it yet. Prelinking is certainly also an option, but there has been a few bugs in the past with reversing the prelinking, so be careful here.

If you're looking for more responsiveness (as opposed to more "speed") then you may want to try Con Kolivas's SD scheduler patch (v1.0 is available here: http://www.kernel.org/pub/linux/kernel/people/ck/patches/staircase-deadline/2.6.22-rc2/2.6.22-rc2-sd-1.00.patch) or Ingo's CFS (available here: http://people.redhat.com/mingo/cfs-scheduler/). Both can substantially improve the responsiveness under heavy loads (compiling, etc.). However, they're still under development, so there may still be bugs and regressions.

Finally, all apple laptops shipped with 4200 RPM drives afaik, buying a faster (7200 RPM) disk would certainly help make your computer seem faster.

As for different compilers, there really isn't anything to suggest for PPC, so that's kind of a moot point. I'd expect less performance gain from the compiler and more from using a better configuration. Plus, you're less likely to really mess things up. :)

Hope that helps!
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
praveen
n00b
n00b


Joined: 08 Jun 2005
Posts: 43

PostPosted: Fri May 25, 2007 3:07 pm    Post subject: Reply with quote

What about --ftree-vectorize ? Is it stable on PPC ?

Could people post their CFLAGS here for comparison if you have the same machine as psihodelia ? I have the same one and I want to check my CFLAGS. I am currently using

Code:

CFLAGS="-O2 -mcpu=7450 -mtune=7450 -maltivec -mabi=altivec -fno-strict-aliasing -pipe"


Is this OK, can I add or remove something ?
_________________
http://pc.freeshell.org/comp/ibook
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum