LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-26-2004, 03:45 PM   #1
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 45
optimized v/s unoptimized


i see some sources where they mention it as being "unoptimized".
is there some technical meaning behind this, or do they mean that they didn;t spend too much time on it?
 
Old 01-26-2004, 04:16 PM   #2
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
Optimization refers to seeking out areas of a program that behave more slowly than desired, or scale poorly, and improving them. Optimization should be one of the LAST things that you do in a program's development cycle, since you won't know where the performance bottlenecks will be until that point. Optimizing before then may end up in no overall performance gain.
 
Old 01-26-2004, 04:17 PM   #3
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 45
great - thanks agin.
 
Old 01-26-2004, 04:58 PM   #4
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 34
Optimizing is not worthwhile if you save 60 seconds of runtime off something that runs one hour. The user will figure the runtime = lunch time
and run it accordingly.

Or if you save few seconds on a short program that runs once a month in batch.

Saving one half-second on a function that is called thousands of times in a program that runs all the time, IS definitely worth doing.

The trade off is cost of programmer time vs the time savings staff will experience.

The only environment where optimization is everything is game development
 
Old 01-26-2004, 05:14 PM   #5
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 45
yes, this IS for game development that I asked. spot on!
 
Old 01-26-2004, 05:16 PM   #6
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 45
so, how is it different for game developers? what do they do differently?
 
Old 01-26-2004, 07:07 PM   #7
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
They probably optimize over and over once their codebase has stabilized. Once you optimize out one bottleneck, you profile again and look for other bottlenecks. Then you optimize thouse out. And so on and so forth until it would become prohibitively difficult to code and/or your performance is acceptable.
 
Old 01-26-2004, 07:19 PM   #8
shellcode
Member
 
Registered: May 2003
Location: Beverly Hills
Distribution: Slackware, Gentoo
Posts: 350

Rep: Reputation: 31
a program may be optimized to take full advantage of a processor's ability. for example a program may use i486 assembly calls. such a program is i486 optimized. it may run on on a i386 only if it is backwards compatible and has a set of i386 calls to replace the i486-specific call (run unoptimized of course). when you run ./configure, AutoConf will determine which arguments to pass to gcc (or other compiler). these arguments are specific to your system. so on my P2, the following arguments to gcc are present "-mcpu=pentium2 -march=pentium2". im not sure if that makes the program backward's compatible with pre-i686 archeitechtures or not, but if it does not, then somewhere along the line, this binary would crash on a P1.
 
  


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
What makes it i686 optimized ? kriton12 Slackware 15 03-21-2005 04:07 AM
is optimized software really faster? shanenin Linux - Software 28 02-25-2005 06:34 PM
optimized? Motown Slackware 2 05-21-2004 08:16 PM
Partions, Optimized avarweth Linux - General 12 12-09-2003 09:46 AM
Optimized Hardware mrsolo Linux - Hardware 1 06-26-2002 08:32 AM


All times are GMT -5. The time now is 12:03 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration