Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Compiler options - what level of optimization?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
Keruskerfuerst
Advocate
Advocate


Joined: 01 Feb 2006
Posts: 2288
Location: near Augsburg, Germany

PostPosted: Sat Feb 04, 2006 8:18 am    Post subject: Compiler options - what level of optimization? Reply with quote

Gcc supports levels of optimization: from -O0 to -O9. What level should I use in /etc/make.conf as compiler option?
Back to top
View user's profile Send private message
SeeLook
Tux's lil' helper
Tux's lil' helper


Joined: 21 Sep 2005
Posts: 82
Location: Poland

PostPosted: Sat Feb 04, 2006 8:47 am    Post subject: Reply with quote

Optimally is -O2. It is enought for "usualy" users.
Flags over -O3 are not used yet.
Regards
Back to top
View user's profile Send private message
krigav
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2005
Posts: 121

PostPosted: Sat Feb 04, 2006 12:50 pm    Post subject: Reply with quote

Use CFLAGS="-march=<YourCPU> -O2 --pipe" respectively for the C++ counterpart of gcc CXXFLAGS="-march=<YourCPU> -O2 --pipe". You have to replace <YourCPU> with your processor type. For example if you have a Pentium III then use CFLAGS="-march=pentium3 -O2 --pipe".

Using more flags like rename-rgisters or inline-function etc. is almost always clueless and don't mean any speed up. Keep just this simple one and you'll have a stable and fast system. Else if it's still to slow you have to buy a faster PC :lol:

A good article about gcc flags can be found under http://www.linuxjournal.com/article/7269
_________________
There are no dumb questions, just dumb answers. So please help users that are new to linux/gentoo by answering unanswered questions.
Back to top
View user's profile Send private message
katswaio
n00b
n00b


Joined: 28 Jan 2006
Posts: 21
Location: Iasi,ro

PostPosted: Sat Feb 04, 2006 1:07 pm    Post subject: Reply with quote

I was in a hurry to get my system set up when installing and didn't give much thought to what level of optimization to use. I chose -Os. I wander if I should've chose -O2... Would it increase my system's performance significantly?
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Sat Feb 04, 2006 1:15 pm    Post subject: Reply with quote

Moved from Installing Gentoo to Duplicate Threads.
moved in favour of https://forums.gentoo.org/viewtopic-t-333123-highlight-cflags+central.html
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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