View previous topic :: View next topic |
Author |
Message |
optiluca Guru
Joined: 16 Jan 2006 Posts: 545 Location: Rivergaro, Italy
|
Posted: Mon Apr 17, 2006 6:23 pm Post subject: Best CFLAGS for amd64 X2 |
|
|
Hi. I wanted to know what you thought were the best CFLAGS / CXXFLAGS on a dual core athlon 64. For best I mean something whith good performance, maybe even a bit mad, don't really care about stability.
Luca |
|
Back to top |
|
|
playfool l33t
Joined: 01 Jun 2004 Posts: 688 Location: Ã
rhus, Denmark
|
Posted: Mon Apr 17, 2006 7:43 pm Post subject: |
|
|
-fomg-optimize |
|
Back to top |
|
|
vipernicus Veteran
Joined: 17 Jan 2005 Posts: 1462 Location: Your College IT Dept.
|
Posted: Mon Apr 17, 2006 9:10 pm Post subject: |
|
|
Here's mine:
Code: | CFLAGS="-march=athlon-xp"
CFLAGS="${CFLAGS} -O2"
CFLAGS="${CFLAGS} -pipe"
CFLAGS="${CFLAGS} -fno-ident"
CFLAGS="${CFLAGS} -ftracer -fweb"
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CFLAGS="${CFLAGS} -ftree-vectorize"
CFLAGS="${CFLAGS} -falign-functions=64"
CFLAGS="${CFLAGS} -freorder-blocks-and-partition"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
CXXFLAGS="${CXXFLAGS} -fno-enforce-eh-specs"
#CXXFLAGS="${CXXFLAGS} -fpermissive"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort" |
And it runs smooth and fast as racecar silk. _________________ Viper-Sources Maintainer || nesl247 Projects || vipernicus.org blog |
|
Back to top |
|
|
Monkeh Veteran
Joined: 06 Aug 2005 Posts: 1656 Location: England
|
Posted: Mon Apr 17, 2006 9:20 pm Post subject: |
|
|
I lol.
Code: | -march=k8 -O2 -pipe |
|
|
Back to top |
|
|
Aries-Belgium l33t
Joined: 08 Jul 2005 Posts: 730 Location: Willebroek, Belgium
|
Posted: Mon Apr 17, 2006 10:11 pm Post subject: |
|
|
Mine:
Quote: | CFLAGS="-O2 -march=k8 -fomit-frame-pointer -pipe -funroll-loops"
CXXFLAGS="-O2 -march=k8 -fomit-frame-pointer -pipe -funroll-loops" |
_________________ Ep2.nl | Developers Community |
|
Back to top |
|
|
optiluca Guru
Joined: 16 Jan 2006 Posts: 545 Location: Rivergaro, Italy
|
Posted: Tue Apr 18, 2006 7:25 am Post subject: |
|
|
vipernicus wrote: | Here's mine:
Code: | CFLAGS="-march=athlon-xp"
CFLAGS="${CFLAGS} -O2"
CFLAGS="${CFLAGS} -pipe"
CFLAGS="${CFLAGS} -fno-ident"
CFLAGS="${CFLAGS} -ftracer -fweb"
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CFLAGS="${CFLAGS} -ftree-vectorize"
CFLAGS="${CFLAGS} -falign-functions=64"
CFLAGS="${CFLAGS} -freorder-blocks-and-partition"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
CXXFLAGS="${CXXFLAGS} -fno-enforce-eh-specs"
#CXXFLAGS="${CXXFLAGS} -fpermissive"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort" |
And it runs smooth and fast as racecar silk. |
Will all those be OK with a 64 bit installation? |
|
Back to top |
|
|
Monkeh Veteran
Joined: 06 Aug 2005 Posts: 1656 Location: England
|
Posted: Tue Apr 18, 2006 7:31 am Post subject: |
|
|
optiluca wrote: | vipernicus wrote: | Here's mine:
Code: | CFLAGS="-march=athlon-xp"
CFLAGS="${CFLAGS} -O2"
CFLAGS="${CFLAGS} -pipe"
CFLAGS="${CFLAGS} -fno-ident"
CFLAGS="${CFLAGS} -ftracer -fweb"
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CFLAGS="${CFLAGS} -ftree-vectorize"
CFLAGS="${CFLAGS} -falign-functions=64"
CFLAGS="${CFLAGS} -freorder-blocks-and-partition"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
CXXFLAGS="${CXXFLAGS} -fno-enforce-eh-specs"
#CXXFLAGS="${CXXFLAGS} -fpermissive"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort" |
And it runs smooth and fast as racecar silk. |
Will all those be OK with a 64 bit installation? |
I doubt it. I highly suggest just going with -march=k8 -O2 -pipe. |
|
Back to top |
|
|
optiluca Guru
Joined: 16 Jan 2006 Posts: 545 Location: Rivergaro, Italy
|
Posted: Tue Apr 18, 2006 7:59 am Post subject: Re: Best CFLAGS for amd64 X2 |
|
|
Monkeh wrote: | optiluca wrote: | vipernicus wrote: | Here's mine:
Code: | CFLAGS="-march=athlon-xp"
CFLAGS="${CFLAGS} -O2"
CFLAGS="${CFLAGS} -pipe"
CFLAGS="${CFLAGS} -fno-ident"
CFLAGS="${CFLAGS} -ftracer -fweb"
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CFLAGS="${CFLAGS} -ftree-vectorize"
CFLAGS="${CFLAGS} -falign-functions=64"
CFLAGS="${CFLAGS} -freorder-blocks-and-partition"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
CXXFLAGS="${CXXFLAGS} -fno-enforce-eh-specs"
#CXXFLAGS="${CXXFLAGS} -fpermissive"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort" |
And it runs smooth and fast as racecar silk. |
Will all those be OK with a 64 bit installation? |
I doubt it. I highly suggest just going with -march=k8 -O2 -pipe. |
optiluca wrote: | For best I mean something whith good performance, maybe even a bit mad, don't really care about stability. Luca |
-O2 -pipe -march=k8 isn't very mad... |
|
Back to top |
|
|
GetCool Guru
Joined: 23 Nov 2003 Posts: 324 Location: Madison, Wisconsin
|
Posted: Tue Apr 18, 2006 8:43 am Post subject: |
|
|
You can also safely add "-msse3" since all X2 processors support sse3.
So, a good, safe CFLAGS setting is:
Code: | CFLAGS="-march=k8 -O2 -pipe -msse3" |
I suggest sticking with the above, as it is safe and stable. That is, if you can stand not having the "-omg-optimized" crap in there that everyone uses but makes absolutely no difference.
Also, remember to set your "MAKEOPTS" for your dual-core CPU:
|
|
Back to top |
|
|
optiluca Guru
Joined: 16 Jan 2006 Posts: 545 Location: Rivergaro, Italy
|
Posted: Tue Apr 18, 2006 8:47 am Post subject: |
|
|
What about -fomit-frame-pointer, -ftree-vectorize and -funroll-loops?? I've seen lots of people using them... Are they of any use? |
|
Back to top |
|
|
GetCool Guru
Joined: 23 Nov 2003 Posts: 324 Location: Madison, Wisconsin
|
Posted: Tue Apr 18, 2006 9:33 am Post subject: |
|
|
optiluca wrote: | What about -fomit-frame-pointer, -ftree-vectorize and -funroll-loops?? I've seen lots of people using them... Are they of any use? |
No. I used to play around with extra optimizations, and I never found them to make any difference whatsoever in any real-world application.
In the end I went back to the simple, safe configuration I mentioned above, which is plenty fast for everything (including gaming, compiling, and other hardware-intensive applications). I'm using an X2 3800+. |
|
Back to top |
|
|
optiluca Guru
Joined: 16 Jan 2006 Posts: 545 Location: Rivergaro, Italy
|
Posted: Tue Apr 18, 2006 9:46 am Post subject: |
|
|
Is there anything for faster app loading? I'm already using prelink, but all apps take more time to load than their windows counterparts...
Thanks for your help |
|
Back to top |
|
|
GetCool Guru
Joined: 23 Nov 2003 Posts: 324 Location: Madison, Wisconsin
|
Posted: Tue Apr 18, 2006 11:41 am Post subject: |
|
|
optiluca wrote: | Is there anything for faster app loading? I'm already using prelink, but all apps take more time to load than their windows counterparts...
Thanks for your help |
There isn't too much you can do beyond what you're already doing with prelink.
You might want to check the fragmentation level of your / filesystem, because if it is fragmented enough it can slow things down. If this is the case, you can make a stage4 backup, reformat and restore.
You could also try to limit swap usage, but my guess is that you aren't using it at all right now anyway, since you probably have enough RAM.
There are other crazy things you can do like mount certain directories to a ramdisk (there's a HOWTO somewhere around here), but I would advise against this, since it could end up causing you major problems. |
|
Back to top |
|
|
optiluca Guru
Joined: 16 Jan 2006 Posts: 545 Location: Rivergaro, Italy
|
Posted: Tue Apr 18, 2006 11:57 am Post subject: |
|
|
Ok... But why do apps take more time to load than in windows? In windows there is no noticeable difference between the 1st time the app is used and the others, in linux it's HUGE, expecially with firefox and openoffice. I'm preloading OO in Ram now, but I haven't found an equivalent solution with firefox... One last question: why are all WMs less responsive than windows? (the ultra-minimalist ones don't count)
PS I'm starting to sound like a Microsoft Employee |
|
Back to top |
|
|
Aries-Belgium l33t
Joined: 08 Jul 2005 Posts: 730 Location: Willebroek, Belgium
|
Posted: Tue Apr 18, 2006 1:13 pm Post subject: |
|
|
I use -funroll-loops and I can see the advantages of it. Compilation is faster, applications using loops run faster, ...
About the WM question. I'm using XFCE and it's running fast as hell. I haven't installed Windows on this computer, so I can't really compair. But my Linux desktop is still running the same then when I just installed it. Windows runs a lot slower after 3 or 4 months. _________________ Ep2.nl | Developers Community |
|
Back to top |
|
|
vipernicus Veteran
Joined: 17 Jan 2005 Posts: 1462 Location: Your College IT Dept.
|
|
Back to top |
|
|
playfool l33t
Joined: 01 Jun 2004 Posts: 688 Location: Ã
rhus, Denmark
|
Posted: Tue Apr 18, 2006 2:07 pm Post subject: |
|
|
optiluca wrote: | What about -fomit-frame-pointer, -ftree-vectorize and -funroll-loops?? I've seen lots of people using them... Are they of any use? |
-fomit-frame-pointer is implied on amd64
Quote: |
You can also safely add "-msse3" since all X2 processors support sse3.
|
False, my AMD64 X2 4400+ reports:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy
no sse3 support. |
|
Back to top |
|
|
optiluca Guru
Joined: 16 Jan 2006 Posts: 545 Location: Rivergaro, Italy
|
|
Back to top |
|
|
playfool l33t
Joined: 01 Jun 2004 Posts: 688 Location: Ã
rhus, Denmark
|
Posted: Tue Apr 18, 2006 2:55 pm Post subject: |
|
|
optiluca wrote: | http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/33425.pdf
sse3 is supported... |
The question then becomes why the kernel does not know this... that's honest to no god the raw output of my /proc/cpuinfo. |
|
Back to top |
|
|
optiluca Guru
Joined: 16 Jan 2006 Posts: 545 Location: Rivergaro, Italy
|
Posted: Tue Apr 18, 2006 4:00 pm Post subject: |
|
|
Mine's the same. But sse3 works... |
|
Back to top |
|
|
meax Tux's lil' helper
Joined: 21 Jul 2004 Posts: 88 Location: Babylon
|
Posted: Tue Apr 18, 2006 4:00 pm Post subject: |
|
|
playfool wrote: | False, my AMD64 X2 4400+ reports:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy
no sse3 support. |
pni == sse3. See http://en.wikipedia.org/wiki/SSE3 _________________ Bullshit makes the flowers grow and that's beautiful. |
|
Back to top |
|
|
optiluca Guru
Joined: 16 Jan 2006 Posts: 545 Location: Rivergaro, Italy
|
Posted: Tue Apr 18, 2006 4:15 pm Post subject: |
|
|
vipernicus wrote: | The LDFLAGS are what makes the difference in startup times. |
How? |
|
Back to top |
|
|
playfool l33t
Joined: 01 Jun 2004 Posts: 688 Location: Ã
rhus, Denmark
|
Posted: Tue Apr 18, 2006 4:54 pm Post subject: |
|
|
meax wrote: | playfool wrote: | False, my AMD64 X2 4400+ reports:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy
no sse3 support. |
pni == sse3. See http://en.wikipedia.org/wiki/SSE3 |
That clears it up, thank you.. I wonder why they strayed from the naming scheme.. marketing I guess. |
|
Back to top |
|
|
Monkeh Veteran
Joined: 06 Aug 2005 Posts: 1656 Location: England
|
Posted: Tue Apr 18, 2006 7:31 pm Post subject: |
|
|
optiluca wrote: | Is there anything for faster app loading? I'm already using prelink, but all apps take more time to load than their windows counterparts...
Thanks for your help |
I'm using a 3700+ with the above CFLAGS and prelink. Firefox starts in about 0.2 of a second at FULL CPU load, compared to several seconds in Windows when idle. |
|
Back to top |
|
|
vipernicus Veteran
Joined: 17 Jan 2005 Posts: 1462 Location: Your College IT Dept.
|
|
Back to top |
|
|
|