LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-24-2005, 11:50 AM   #1
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
is optimized software really faster?


If you have a system like gentoo that is optimiized for you specific processor, althon xp in my case. Is this truely faster then a system built with bianaries that are built to run on an i386 machine? I realize in theory they are, but in practice can anyone really tell the difference? Are there any benchmarks that show the difference?
 
Old 02-24-2005, 11:56 AM   #2
Scorpio
Member
 
Registered: May 2004
Distribution: Ubuntu Warty
Posts: 61

Rep: Reputation: 15
Not sure about benchmarks but they would be faster than binaries.
Only bad thing about the optimisation of say gentoo is the compile time.
Especailly on older pcs imo.
 
Old 02-24-2005, 01:20 PM   #3
Hammett
Senior Member
 
Registered: Aug 2003
Location: Barcelona, Catalunya
Distribution: Gentoo
Posts: 1,042

Rep: Reputation: 54
I use Gentoo and since I hit Linux Gentoo 2.6.9 on grub, until Fluxbox is ready, the elapsed time is 1minute....
Before I was using FC3 and it took around 1:35 - 1:40 to start up.

I really think it's way faster, but, as said above, compilation sometimes is endless (took me more than 1h to compile qt libraries)
 
Old 02-24-2005, 01:25 PM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
this is only for floating point math so the results are not that significant overall
http://home.comcast.net/~jcunningham...imization.html
his results with athlon xp show roughly 47% increase in speed from
-O3 -march=i386 350 seconds
to
-march=athlon-xp -O3 -ffast-math -malign-double -funroll-loops -pipe -fomit-frame-pointer -msse -mfpmath=sse,387 241 seconds

the results would be even greater if he had used -O2 on the baseline

on my own machine i did tests once and came up with an overall increase of 11% for i/o throughput
but that was just with compiling the test with different flags.

if you were to factor in how much slower it would actually be on a non optimized kernel/non optimized filesystem etc i would imagine it would be at least 25% or greater
 
Old 02-24-2005, 01:33 PM   #5
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Original Poster
Rep: Reputation: 30
thanks, that is some good information.
 
Old 02-24-2005, 01:41 PM   #6
Hammett
Senior Member
 
Registered: Aug 2003
Location: Barcelona, Catalunya
Distribution: Gentoo
Posts: 1,042

Rep: Reputation: 54
Quote:
Originally posted by foo_bar_foo
this is only for floating point math so the results are not that significant overall
http://home.comcast.net/~jcunningham...imization.html
his results with athlon xp show roughly 47% increase in speed from
-O3 -march=i386 350 seconds
to
-march=athlon-xp -O3 -ffast-math -malign-double -funroll-loops -pipe -fomit-frame-pointer -msse -mfpmath=sse,387 241 seconds

the results would be even greater if he had used -O2 on the baseline

on my own machine i did tests once and came up with an overall increase of 11% for i/o throughput
but that was just with compiling the test with different flags.

if you were to factor in how much slower it would actually be on a non optimized kernel/non optimized filesystem etc i would imagine it would be at least 25% or greater
So, which are the desirabel optimization flags? All of them?? I mean, I'm not a guru in hardware/software and I didn't change that much the optimizations for my arch (-O2 -march=pentium4 -fomit-frame-pointer), so I really don't know if I should put more and more flags to the make.conf file for getting a faster machine or, on the contrary, putting more flags will end up in a mess....
 
Old 02-24-2005, 02:43 PM   #7
PMorph
Member
 
Registered: Sep 2003
Distribution: Debian
Posts: 213

Rep: Reputation: 31
I'm sure these optimizations can really make a difference in computationally heavy tasks, like 3D rendering, audio/video encoding etc. number crunching.

But I doubt it makes any noticeable difference in the everyday desktop usage, X performance?
Or does it? Anyone?
 
Old 02-24-2005, 02:53 PM   #8
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
I don't think it creates a noticeable difference at all. Don't get me wrong, I use and love gentoo, but not for any supposed speed increase.

I used to be one of those gentoo 'ricers' that used uber-optimized gcc flags, but gave up because of broken builds and unstable software. Now I use a 'sober' -O2

While a .002 second speed increase may be nice in the HPC domain, it is meaningless to your typical end user.

Real gentoo'ers know the reason we use it is because of:
1. choice
2. portage

not any supposed speed increase.
 
Old 02-24-2005, 02:57 PM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
Quote:
Originally posted by Hammett
I use Gentoo and since I hit Linux Gentoo 2.6.9 on grub, until Fluxbox is ready, the elapsed time is 1minute....
Before I was using FC3 and it took around 1:35 - 1:40 to start up.

I really think it's way faster, but, as said above, compilation sometimes is endless (took me more than 1h to compile qt libraries)
Heh ... Slackware 8.1 ("optimized" for i386) was booting in 40
seconds on a P4 1.6 ... Mandreck (i586) on the same machine
was booting in 110 ... does that mean that i386 code is faster? Or
do you think it might be due to different services that are being
started and the way the init-scripts work?

As others have pointed out ... it won't have much impact on
everyday work. I noticed a negligable difference in e.g.
video-stream encoding when I recompiled transcode (and
the libs it uses) for -march=pentium4 -msse2 ... encoding
the same video gained just under a minute, which doesn't
make a lot of a difference when you're looking at 7 hours ;)


Cheers,
Tink
 
Old 02-24-2005, 03:02 PM   #10
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,692

Rep: Reputation: 45
in case anyone missed the 'ricer' reference:
http://funroll-loops.org/ careful, naughty language therein.

Last edited by rshaw; 02-24-2005 at 03:04 PM.
 
Old 02-24-2005, 04:02 PM   #11
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
Quote:
Originally posted by Hammett
So, which are the desirabel optimization flags? All of them?? I mean, I'm not a guru in hardware/software and I didn't change that much the optimizations for my arch (-O2 -march=pentium4 -fomit-frame-pointer), so I really don't know if I should put more and more flags to the make.conf file for getting a faster machine or, on the contrary, putting more flags will end up in a mess....
Too much is a bad thing and can have a negative impact on performance. If you put too many in, you will start to see erratic behavior/crashes from some of your applications.

do a google as there are alot of references out there:

http://home.comcast.net/~jcunningham...ion_Flags.html
http://freshmeat.net/articles/view/730/
http://www.emerson.emory.edu/service...e_Options.html
 
Old 02-24-2005, 04:14 PM   #12
dastrike
Member
 
Registered: Apr 2004
Location: Stockholm, Sweden
Distribution: Debian 'sid'
Posts: 250

Rep: Reputation: 30
Overall: the actual performance increase is not really worth the time spent on recompiling everything with every bell-and-whizbang-"optimization"-settings.

But in specific cases of particular programmes there are noticeable performance increases though.

As with all performance optimization: identify your bottleneck first. Then resolve that bottleneck and move onto the next bottleneck. There are many bottlenecks to fix before one needs to go beyond a plain -O2 optimization during compilation (and in many cases an -O3 just makes the code slower and the executable far more bloated sizewise).
 
Old 02-24-2005, 04:19 PM   #13
voyciz
Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 425

Rep: Reputation: 40
In the March edition of Linux Journal, a test was conducted with a script that "performs a bubble search over 10,000 elements. The elements in the array have been reversed to force the worst-case scenario". Results:

$ gcc -o sort sort.c -O2
$ time ./sort

real 0m1.036s
user 0m2.030s
sys 0m0.000s

$ gcc -o sort sort.c -O2 -march=pentium2
$ time ./sort

real 0m0.799s
user 0m0.790s
sys 0m0.010s

There was a 237ms (23%) speed increase. The tests were conducted on a 633MHz Celeron. Hope this helps.
 
Old 02-24-2005, 04:33 PM   #14
sh1ft
Member
 
Registered: Feb 2004
Location: Ottawa, Ontario, Can
Distribution: Slackware, ubuntu
Posts: 391

Rep: Reputation: 31
Im sorry but this gentoo speed increase crap is a bunch of bs. It does nothing to decrease interactivity and latency and is mostly useless on a desktop os. I'd rather wait .0002 seconds longer for firefox to startup then waste 10 hours compiling it. What a waste of time and cpu cycles. The only difference it makes is in programs that occupy the cpu 100% and do caclulation intensive tasks like number crunching and video or music encoding.

In fact for some programs it INCREASES startup time by making the binary bigger.

In the words of Vanilla Ice:

rice rice baby...

Last edited by sh1ft; 02-24-2005 at 04:34 PM.
 
Old 02-24-2005, 05:20 PM   #15
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Could have sworn that's what I said 6 posts ago, but a lot more politely.
Stop equating gentoo users with ricers. We're not all boneheads you know.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: Faster and Faster Compilation jeremy LinuxAnswers Discussion 5 12-06-2005 02:41 AM
optimized? Motown Slackware 2 05-21-2004 09:16 PM
optimized v/s unoptimized h/w Programming 7 01-26-2004 08:19 PM
Partions, Optimized avarweth Linux - General 12 12-09-2003 10:46 AM
Optimized Hardware mrsolo Linux - Hardware 1 06-26-2002 09:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration