View previous topic :: View next topic |
Author |
Message |
JustGags n00b
Joined: 29 Apr 2005 Posts: 32
|
Posted: Sun Sep 03, 2006 2:45 am Post subject: -O2 or -Os |
|
|
-O2 or -Os
Which is "better"? Why? |
|
Back to top |
|
|
yabbadabbadont Advocate
Joined: 14 Mar 2003 Posts: 4791 Location: 2 exits past crazy
|
Posted: Sun Sep 03, 2006 2:48 am Post subject: |
|
|
If you are worried about the final size of the compiled binaries, then use -Os, otherwise -O2. _________________
Bones McCracker wrote: | On the other hand, regex is popular with the ladies. |
|
|
Back to top |
|
|
JustGags n00b
Joined: 29 Apr 2005 Posts: 32
|
Posted: Sun Sep 03, 2006 4:10 am Post subject: |
|
|
Any speed difference either in compiling or binary performance? |
|
Back to top |
|
|
Phenax l33t
Joined: 10 Mar 2006 Posts: 972
|
Posted: Sun Sep 03, 2006 4:12 am Post subject: |
|
|
Well, I'd say that -Os is better for machines with a limited amount of RAM or harddrive space, while more powerful machines would like -O2.
-O2 is more raw performance and -Os is performance with all of the flags that increase size filtered out. It makes your system use less RAM and less harddrive space.
Although -O2 would probably give you better 'raw performance.'
They both should compile at generally the same time. |
|
Back to top |
|
|
Headrush Watchman
Joined: 06 Nov 2003 Posts: 5597 Location: Bizarro World
|
Posted: Sun Sep 03, 2006 4:32 am Post subject: |
|
|
Depends on your arch too.
If you've got a Via CPU, -Os. (Though I'm guessing you don't have this.)
JustGags wrote: | Any speed difference either in compiling or binary performance? |
What kind of hardware to you have?
Anything modern you probably won't notice enough of a difference either way.
Some software probably can benefit from optimizations from both, but it depends on the package. |
|
Back to top |
|
|
BRPXQZME Apprentice
Joined: 23 Mar 2006 Posts: 163 Location: Centreville, VA
|
Posted: Sun Sep 03, 2006 5:31 am Post subject: |
|
|
IMHO, -Os is better than -O2 for most things, but there were a few things that broke for me with -Os and GCC4, so I run -O2 for just about everything (mmm laziness).
-Os I think might compile slightly slower (this is entirely in my imagination, not a hard fact )
Since my computer has some kinda slow buses between HD, RAM, and the P4, I'd really like to go with -Os, because I'd notice the difference... even though it's just a little and mostly psychological.
The choice really depends on you and your system. _________________ Firefox is spelled F-i-r-e-f-o-x - only the first letter capitalized (i.e. not FireFox, not Foxfire, FoxFire or whatever else a number of folk seem to think it to be called.) The preferred abbreviation is "Fx" or "fx".
FF = Final Fantasy. |
|
Back to top |
|
|
H-Dragon Guru
Joined: 22 Oct 2002 Posts: 547
|
Posted: Sun Sep 03, 2006 9:47 am Post subject: |
|
|
-Os = -O2 + small_size_where_appropriate _________________ WEBSITE
Do not meddle with the affairs of Dragons, for you are crunchy and tasty with ketchup! |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Sun Sep 03, 2006 9:54 am Post subject: |
|
|
Moved from Portage & Programming to Duplicate Threads. Too many topics like CFLAGS Central (Part 2) about this. _________________ KDE |
|
Back to top |
|
|
|