Re: Optimal programming advice
- From: "Kevin G. Rhoads" <kgrhoads@xxxxxxxxxxxx>
- Date: Wed, 07 Sep 2005 15:56:24 +0000
>Does anyone know of any good general guidelines for making code faster?
1) Profiling and measurement. Theories are nice, data is better.
2) Time/Space trade-offs -- precompute tables and look-up, but don't assume that is faster, measure it.
3) Trading clarity for speed is ALWAYS a mistake, except in throw-away code. (No code is *really* throw-away.)
4) Optimize from high level to lower levels (e.g., don't spend lots of time trying to hand optimize some sub in
assembly until the last (probably never) step). Major code organization issues first! Loop orders on multi-
dimensional arrays &c.
5) Will a 10% speed improvement really mean anything to anyone? Or do you need 10x for it to be worthwhile?
.
- Follow-Ups:
- Re: Optimal programming advice
- From: David Flower
- Re: Optimal programming advice
- From: glen herrmannsfeldt
- Re: Optimal programming advice
- References:
- Optimal programming advice
- From: Glyn Edwards
- Optimal programming advice
- Prev by Date: Re: Optimal programming advice
- Next by Date: Re: Optimal programming advice
- Previous by thread: Re: Optimal programming advice (Attn: Mr. James Van Buskirk)
- Next by thread: Re: Optimal programming advice
- Index(es):