On Sat, Mar 23, 2002 at 03:03:28AM -0500, Paul Smith wrote:
> %% Dave Trollope <dave.trollope_at_worldnet.att.net> writes:
>
> >> Yes, but what is the cost of the malloc?
>
> dt> What does the cost matter when it can be reduced to 10% of the cost?
>
> This is an easy mistake to make when approaching optimization. There is
> often great benefit to _not_ optimizing code. There is quite commonly a
> tradeoff between "slow" methods that are clearer, simpler, more
> reliable, etc., and optimized methods which are more abstract, less
> obviously correct, harder to understand and modify in the future, and
> potentially less robust.
>
> Optimization is best done like this: write the code the most
> straightforward way you can (XP uses the phrase "the simplest thing that
> could possibly work", which I like). Run it. If it's slow, use some
> kind of empirical evidence gathering method (profilers, etc.) to find
> out where the bottlenecks are. Fix the top bottleneck or two. It's
> almost always true that (a) you rarely guess right: the bottlenecks you
> find are nothing like what you thought they'd be, and (b) optimization
> follows the 80/20 rule: you can get 80% of the results for 20% of the
> work, then it takes the other 80% of the work to get the last 20% of the
> results.
Or to put it in a single sintence:
Don't optimise before it hurts.
Bye
Dominik ^_^ ^_^
--
Dominik Vogt, dominik.vogt_at_gmx.de
Reply-To: dominik.vogt_at_gmx.de
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Sat Mar 23 2002 - 06:01:07 GMT