| View previous topic :: View next topic |
| Author |
Message |
natros n00b

Joined: 26 Sep 2003 Posts: 70
|
Posted: Fri Oct 30, 2009 6:53 pm Post subject: Gentoo Optimizations Benchmarked |
|
|
Very interesting
http://www.linux-mag.com/id/7574/1/ _________________ -=[abit ip35 pro core2quad q6600 (oc 3.0 ghz) 8 gb ram 2x320 raid0 ext4 xfx8800gt 512mb]=- |
|
| Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 30108 Location: 56N 3W
|
Posted: Sat Oct 31, 2009 8:42 am Post subject: |
|
|
natros,
Thank you for the link _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
| Back to top |
|
 |
Hypnos Advocate


Joined: 18 Jul 2002 Posts: 2768 Location: Omnipresent
|
Posted: Sat Oct 31, 2009 10:15 am Post subject: |
|
|
Given the small gap between the different GCC optimization levels, and the large gap between Gentoo and Ubuntu in some tests, perhaps a comparison of different USE flag sets would be more useful. _________________ Personal overlay | Simple backup scheme |
|
| Back to top |
|
 |
rahulthewall Veteran


Joined: 01 Nov 2007 Posts: 1264 Location: Zürich
|
Posted: Sat Oct 31, 2009 12:49 pm Post subject: |
|
|
I came here to post it - too late I guess. Allow me to say this: Gentoo FTW!
This does match with my own experience as well, my Gentoo system has always been far more responsive that Ubuntu and even Arch. _________________ Who shall guard the guards? |
|
| Back to top |
|
 |
XQYZ Apprentice


Joined: 19 Jul 2009 Posts: 231 Location: Europe
|
Posted: Sat Oct 31, 2009 1:35 pm Post subject: |
|
|
| Same for me. Ubuntu has always lagged massively on my computer (which is AMD X2 5200+ w/ 2.7Ghz, 4GB RAM and a GeForce 9800GT). Gentoo on the other hand runs snappy as it's supposed to be. Also of course, portage is the best package manager I can imagine. |
|
| Back to top |
|
 |
Thaidog Veteran


Joined: 19 May 2004 Posts: 1036 Location: Hilton Head, SC
|
|
| Back to top |
|
 |
wswartzendruber Veteran


Joined: 23 Mar 2004 Posts: 1205 Location: Jefferson, USA
|
|
| Back to top |
|
 |
Sadako Advocate


Joined: 05 Aug 2004 Posts: 3753 Location: sleeping in the bathtub
|
|
| Back to top |
|
 |
widremann Veteran

Joined: 14 Mar 2005 Posts: 1314
|
Posted: Sun Nov 01, 2009 5:19 am Post subject: |
|
|
| Hypnos wrote: | | Given the small gap between the different GCC optimization levels, and the large gap between Gentoo and Ubuntu in some tests, perhaps a comparison of different USE flag sets would be more useful. |
Somehow I doubt that'd actually make much of a difference for most USE flags. |
|
| Back to top |
|
 |
wswartzendruber Veteran


Joined: 23 Mar 2004 Posts: 1205 Location: Jefferson, USA
|
Posted: Sun Nov 01, 2009 5:19 am Post subject: |
|
|
| Hopeless wrote: | Dupe!
Silly marines.
 |
Well, that settles it. I have offically FAILED. I shall now commence the depression ceremony.
...
Okay I'm done. |
|
| Back to top |
|
 |
widremann Veteran

Joined: 14 Mar 2005 Posts: 1314
|
Posted: Sun Nov 01, 2009 5:22 am Post subject: |
|
|
| I don't know what they do, but Ubuntu and especially Fedora is considerably less responsive on my machine than Gentoo. Firefox scrolling, for example, is always laggy under Ubuntu, even without a compositing manager, while on Gentoo, it's not laggy at all while running a compositing manager! Drawing performance is usually terrible. I can see windows draw as they are opened, while it is usually nearly instantaneous on Gentoo (except for the big hog programs). Program startup time is a little bit better, but I think they have done some optimizations for that. |
|
| Back to top |
|
 |
Akkara Administrator


Joined: 28 Mar 2006 Posts: 4365 Location: &akkara
|
Posted: Sun Nov 01, 2009 5:28 am Post subject: |
|
|
Merged two posts - this and that one, above.
(And my you all type fast, there's now three posts between my comment and the relevant merged posts, making the typical short-and-sweet 'merged N above' hard to use!) |
|
| Back to top |
|
 |
david_e n00b


Joined: 27 Jul 2007 Posts: 51 Location: Berlin, Germany
|
Posted: Sun Nov 01, 2009 11:33 am Post subject: |
|
|
| Maybe it has to do with -march: that can make a huge difference... btw I think that also Ubuntu is compiled -O2. |
|
| Back to top |
|
 |
wswartzendruber Veteran


Joined: 23 Mar 2004 Posts: 1205 Location: Jefferson, USA
|
Posted: Sun Nov 01, 2009 3:25 pm Post subject: |
|
|
| david_e wrote: | | Maybe it has to do with -march: that can make a huge difference... btw I think that also Ubuntu is compiled -O2. |
I remember doing some tests back in 2005 with GCC3 and came to the definite conclusion that it wasn't about architecture but optimization level instead. |
|
| Back to top |
|
 |
zyko l33t


Joined: 01 Jun 2008 Posts: 617 Location: Munich, Germany
|
Posted: Sun Nov 01, 2009 3:38 pm Post subject: |
|
|
Thanks for the link!
Notice how in some scenarios -Os performs much better than higher optimization levels. It would have been interesting to expand a little on those tests and profile if this is really due to a more favorable memory footprint (as the article speculates) or whether some optimization patterns actually hurt computational performance in specific cases.
I would also love to see measurements of memory consumption. Maybe I'll do some myself. |
|
| Back to top |
|
 |
david_e n00b


Joined: 27 Jul 2007 Posts: 51 Location: Berlin, Germany
|
Posted: Sun Nov 01, 2009 4:04 pm Post subject: |
|
|
| wswartzendruber wrote: | | david_e wrote: | | Maybe it has to do with -march: that can make a huge difference... btw I think that also Ubuntu is compiled -O2. |
I remember doing some tests back in 2005 with GCC3 and came to the definite conclusion that it wasn't about architecture but optimization level instead. |
I never benchmarked it, but, for example, SSE should have a noticeable impact on codes that are designed for it, like FFTW. |
|
| Back to top |
|
 |
Sadako Advocate


Joined: 05 Aug 2004 Posts: 3753 Location: sleeping in the bathtub
|
Posted: Sun Nov 01, 2009 4:42 pm Post subject: |
|
|
| david_e wrote: | | wswartzendruber wrote: | | david_e wrote: | | Maybe it has to do with -march: that can make a huge difference... btw I think that also Ubuntu is compiled -O2. |
I remember doing some tests back in 2005 with GCC3 and came to the definite conclusion that it wasn't about architecture but optimization level instead. |
I never benchmarked it, but, for example, SSE should have a noticeable impact on codes that are designed for it, like FFTW. | Yeah, but aren't such optimizations controlled by configure flags (and hence USE flags in the case of gentoo) rather than CFLAGS?
| zyko wrote: | Thanks for the link!
Notice how in some scenarios -Os performs much better than higher optimization levels. It would have been interesting to expand a little on those tests and profile if this is really due to a more favorable memory footprint (as the article speculates) or whether some optimization patterns actually hurt computational performance in specific cases.
I would also love to see measurements of memory consumption. Maybe I'll do some myself. | That's what caught my attention moreso than anything as well.
I have of late been compiling more and more packages with different -O levels via /etc/portage/env, anything which is always running but is mostly idle and performance is a non-issue gets -Os, other select packages which put the system under load get -O3, and -O2 is in make.conf for everything else.
I have to be honest, though, I've tested a few things and in most cases I see very little difference (if any) between the three levels, but there are some stand out cases.
For example, libgcrypt, with -O3 it's actually more than twice as fast as with -O2, although the code I was testing with only used the cryptographic hashes, and libtomcrypt was generally quite a bit faster with the same hashes (which saw more modest but real speed improvements under -O3 also, about 20% faster IIRC).
I'd really like to start testing everything which could potentially benefit from -O3, which would mostly be limited to anything related to compression, cryptography, and any kind of rendering.
As for -Os, I'd like to use that by default with more exceptions via /etc/portage/env where appropriate, whoever in all honesty I doubt there is much to be gained in terms of memory usage;
just about anything which uses a significant amount of memory will do so due the the data which is loaded and internal structures it uses, which should be unaffected by the -O level.
Having said that, I've recently recompiled all the qt and kde libraries with -Os and have seen some significant drop in the library sizes, they're around 15% smaller in some cases, but again how much of an actual saving this gives at runtime is anyone's guess.
I would really like to start coming up with real recommendations for specific -O levels for specific packages though, anyone else? _________________ "You have to invite me in" |
|
| Back to top |
|
 |
Thaidog Veteran


Joined: 19 May 2004 Posts: 1036 Location: Hilton Head, SC
|
Posted: Sun Nov 01, 2009 5:12 pm Post subject: |
|
|
| widremann wrote: | | I don't know what they do, but Ubuntu and especially Fedora is considerably less responsive on my machine than Gentoo. Firefox scrolling, for example, is always laggy under Ubuntu, even without a compositing manager, while on Gentoo, it's not laggy at all while running a compositing manager! Drawing performance is usually terrible. I can see windows draw as they are opened, while it is usually nearly instantaneous on Gentoo (except for the big hog programs). Program startup time is a little bit better, but I think they have done some optimizations for that. |
Yeah I get the same issues with Firefox under FC11. Especially when scrolling down, say, this thread for instance.... FF just grays out and goes crazy scrolling way past where I wanted it to. I think if FF was compiled and the kernel actually had the correct cpu driver it would not happen. Gentoo never does this for me. _________________ www.LinuxDNA.com
http://groups.google.com/group/linuxdna
Registered Linux User: 437619
"I'm a big believer in technology over politics" - Linus Torvalds |
|
| Back to top |
|
 |
d2_racing Moderator


Joined: 25 Apr 2005 Posts: 13034 Location: Ste-Foy,Canada
|
Posted: Sun Nov 01, 2009 8:08 pm Post subject: |
|
|
That's great news about -O2  _________________ Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec |
|
| Back to top |
|
 |
Simba7 l33t


Joined: 22 Jan 2007 Posts: 637 Location: Billings, MT, USA
|
Posted: Sun Nov 01, 2009 8:37 pm Post subject: |
|
|
I always use -O2 in all my builds. Probably why my older systems run extremely well (my ol' P1s and 2's). _________________ Router(PE1750,4GB RAM,3x36GB HDDs,2xIntel Pro/1000+GT Quad Port) | MyDT(PhmIIx3 720@3.3GHz,8GB RAM,500GB+1.5TB+2TB HDDs,GFGTS250,LG BD-RE,Win7)
MyLT(Asus G53SX,32GB RAM,2x750GB HDDs,BD-RE,Intel 6230,Win7) | Wife(A64@2GHz,2GB RAM,120GB HDD,DVD/CD-RW,Win7) |
|
| Back to top |
|
 |
zyko l33t


Joined: 01 Jun 2008 Posts: 617 Location: Munich, Germany
|
Posted: Sun Nov 01, 2009 11:47 pm Post subject: |
|
|
| Quote: | As for -Os, I'd like to use that by default with more exceptions via /etc/portage/env where appropriate, whoever in all honesty I doubt there is much to be gained in terms of memory usage;
just about anything which uses a significant amount of memory will do so due the the data which is loaded and internal structures it uses, which should be unaffected by the -O level. |
Agreed. However, even very minor memory savings can be of value for embedded systems or virtual servers. If -Os reduces the amount of memory occupied by cached binaries, that would make a noticeable difference for systems running on very restricted resources. That may potentially increase the amout of virtual servers one can run on one physical server, thereby saving some money etc...
| Quote: | | I would really like to start coming up with real recommendations for specific -O levels for specific packages though, anyone else? |
Me too  |
|
| Back to top |
|
 |
saellaven Tux's lil' helper

Joined: 23 Jul 2006 Posts: 113
|
Posted: Mon Nov 02, 2009 12:09 am Post subject: |
|
|
| zyko wrote: | Thanks for the link!
Notice how in some scenarios -Os performs much better than higher optimization levels. It would have been interesting to expand a little on those tests and profile if this is really due to a more favorable memory footprint (as the article speculates) or whether some optimization patterns actually hurt computational performance in specific cases.
I would also love to see measurements of memory consumption. Maybe I'll do some myself. |
Without investigating, it's possible the -Os code generated code which fit into CPU cache, whereas the other optimization levels didn't. If there was heavy looping involved with little need to pull in more data/code, the smaller code could easily beat the pants off more "optimized" but longer code. _________________ Athlon 64 X2 4400+ / Asus M2N-E
Athlon 2650e (Acer Aspire 5515)
Pentium D 945 / Dell Optiplex 745 |
|
| Back to top |
|
 |
Thaidog Veteran


Joined: 19 May 2004 Posts: 1036 Location: Hilton Head, SC
|
Posted: Mon Nov 02, 2009 10:55 pm Post subject: |
|
|
| saellaven wrote: | | zyko wrote: | Thanks for the link!
Notice how in some scenarios -Os performs much better than higher optimization levels. It would have been interesting to expand a little on those tests and profile if this is really due to a more favorable memory footprint (as the article speculates) or whether some optimization patterns actually hurt computational performance in specific cases.
I would also love to see measurements of memory consumption. Maybe I'll do some myself. |
Without investigating, it's possible the -Os code generated code which fit into CPU cache, whereas the other optimization levels didn't. If there was heavy looping involved with little need to pull in more data/code, the smaller code could easily beat the pants off more "optimized" but longer code. |
Maybe but if the code loops could be vectorized, which O3 does now, it would probably be better to use O3. The problem I see with making any speculations is that most of these benchmarks require more than one program to run so even if we are simply testing a single app there are a lot of moving wheels under it that take up resources too. I think it gets down to a case by case basis and what apps and deps should be compiled how gets very complicated. _________________ www.LinuxDNA.com
http://groups.google.com/group/linuxdna
Registered Linux User: 437619
"I'm a big believer in technology over politics" - Linus Torvalds |
|
| Back to top |
|
 |
likewhoa l33t

Joined: 04 Oct 2006 Posts: 729 Location: Brooklyn, New York
|
Posted: Wed Nov 04, 2009 12:42 am Post subject: |
|
|
| i love me some benchmarks, thanks for this! |
|
| Back to top |
|
 |
zeek Guru


Joined: 16 Nov 2002 Posts: 473 Location: Bantayan Island
|
Posted: Wed Nov 04, 2009 8:54 am Post subject: |
|
|
| Holy cow Gentoo roasted Ubuntu! |
|
| Back to top |
|
 |
|