Re: [OT] Premature optimizations
Re: [OT] Premature optimizations
- Subject: Re: [OT] Premature optimizations
- From: Allan Odgaard <email@hidden>
- Date: Mon, 2 Aug 2004 01:13:53 +0200
On 1. Aug 2004, at 15:29, Georg Tuparev wrote:
"Premature optimization is the root of all evil in programming."
Yes and goto considered harmful [...]
The quote is a reflection of the fact that before you know the
overall behavior of your system, it's difficult to know what parts
will dominate its overall performance. [...]
Since many years my team is following (loosely) eXtreme Programming.
One of the things we do different is that we optimize during the
refactoring. [...]
Although the discussion was sort of closed, the lack of any sort of
consensus about the topic probably stems from people talking apples and
oranges.
Optimization can refer to selecting the proper data
structure/algorithm, writing code to better help the compiler generate
efficient assembler, shave down the number of cycles spent by
introducing condition-checks before executing some code and/or cache
results, re-structure memory layout to improve cache hit-ratio etc.
etc. etc.
Wrt profiling, in one end an application can be a closed system (i.e.
all code executed is written by the programmer, which should then be
intimately aware of what goes on) or it can rely heavily on libraries,
frameworks, i/o, or other external services (for which the programmer
has little knowledge about bottlenecks).
When it comes to requirements, in one end of the spectra we have games,
simulators, problem-solvers, or other real-time applications, and in
the other end we may have a web-application which needs to perform a
single service on a 2 GHz server with data sent and received from a
dial-up connection.
I have seen many general claims in the thread which I am sure would not
apply to the entire range of things I mention above, and that is
probably part of the reason for the extreme disagreement on the topic
of when to optimize.
Just my final 2 cents...
--
http://macromates.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.