Compiling optimization settings

Anything that pertains to Portage

Moderator: Moderators

Compiling optimization settings

Postby flick » Wed Jul 11, 2007 4:32

Hi, everyone!

Just did a fresh install of 3.4 loop3, checked out /etc/make.conf, and noticed that -Os was used instead of -O2 as in 3.3

I know that -Os is intended to optimize more for size than performance. Just curious if the Sabayon devs, or anyone more experienced with Gentoo and/or Sabayon, had any thoughts on stuff being compiled with -Os rather than -O2. Reason being, I was about to rebuild my system, tailored to my hardware. Did it with 3.3, sure I can do it again.

So, any thoughts, anyone?
flick
Growing Hen
 
Posts: 119
Joined: Wed Jan 03, 2007 15:09
Location: Milwaukee, WI

Postby WarraWarra » Wed Jul 11, 2007 8:01

Think -O2 is better option can not remember why / long time ago. Should be optimization / cleaner if higher number ?

-j3 - s for makeopts or cpu+1 = -j2, dual core+1 = -j3 adds a lot of speed as well as -pipe after "-O2 -march=prescott -pipe" paralle fetch si good for slow inet connection but can be cheated by first downloading all files and then compile from a repository ?

Somehow -j16 -s has worked for my core duo t2600 2.16ghz laptop cpu but -j5 locksup ?
No one has explained or updated the -j options yet as surely they where put in place for a 486 or 586 cpu so a core duo is 8x or 12x 586 cpu's equivalent or 16x 486 cpu's ?

If you can google for your cpu and make options then the most fine tuned ones should be out there and you can copy them , also helps to know if a option is safe and tested before trying to fry a cpu LOL

Hope this helps.
User avatar
WarraWarra
Sagely Hen
 
Posts: 1989
Joined: Wed Jan 03, 2007 21:01
Location: 31.324270, -113.585511

Postby nikaya » Wed Jul 11, 2007 9:49

Image
former john_doe
User avatar
nikaya
Growing Hen
 
Posts: 162
Joined: Wed Oct 04, 2006 18:12
Location: Germany

Postby dawn`chorus » Thu Jul 12, 2007 2:47

Here's a spot where you can find safe CFLAGS for your architecture.

http://gentoo-wiki.com/Safe_Cflags

What are CFLAGS?

http://gentoo-wiki.com/CFLAGS
dawn`chorus
Baby Hen
 
Posts: 12
Joined: Wed Jul 11, 2007 8:21

Postby flick » Thu Jul 12, 2007 19:03

Thanks, all. I have read those pages/sites you've all linked. Sorry I wasn't clear enough in my original post : any anecdotal evidence re : compiling with -Os versus -O2? Anyone here happier with one or the other, and why?
flick
Growing Hen
 
Posts: 119
Joined: Wed Jan 03, 2007 15:09
Location: Milwaukee, WI

Postby dawn`chorus » Fri Jul 13, 2007 1:32

-O2 has been very good for me. Quite stable, which is my thang. :)

-Os optimizes for size. -Os enables all -O2 optimizations that do not usually increase code size and performs further optimizations designed to reduce code size.

-Os is very useful for large applications, like Firefox, as it will reduce load time, memory usage, cache misses, disk usage etc. Code compiled with -Os can be faster than -O2 or -O3 because of this. It's also recommended for older computers with a low amount of RAM, disk space or cache on the CPU. But beware that -Os is not as well tested as -O2 and might trigger compiler bugs.

Note that only one of the above flags may be chosen. If you choose more than one, the last one specified will have the effect.
dawn`chorus
Baby Hen
 
Posts: 12
Joined: Wed Jul 11, 2007 8:21


Return to Portage|Emerge Package Managers

Who is online

Users browsing this forum: toster and 2 guests