Slimelite BBS

Re: Speeding up C

Back to R25C

From Steve Dyson · 1996-04-08 22:17 · #75252 in R25C

In reply to Speeding up C by Matthew Probert

 -=> Quoting Matthew Probert to All <=-

Matthew,

An interesting contribution though I notice you don't mention the
Pareto effect. Where usually 90% of the processing time is spent on 10%
of the code (and 99% of misguided optimization efforts are only 1%
effective! :-)

One piece in you missive I would like to raise (or should that be rase)...

 MP> NB: Although it is normal practice for expressions to be evaluated
 MP> left to right, the ANSI standard on C does not specify an order of 
 MP> preference for expression evaluation, and as such you should check 
 MP> your compiler manual. 

IMHO such practice should be shunned by all programmers of any worth! To
justify this remark I would point out that any such code can cause such
havok and cost so dearly when the target hardware changes or when the
development environment changes.

If the order of evaluation is imperative and if it is not covered in the
recognized standard then either the expression should be broken into
smaller expressions or brackets should be used. I beleive that what you
are advocating is a recipe for nervous breakdowns for maintenance staff
years/months/days? hence.

Regards,
Steve.

--- Blue Wave/RA v2.12
 * Origin: From The Crystal Tower : London (0181-4478244) (2:254/220)