fast code and no morals

rb at ccivax rb at ccivax
Sat Jan 25 10:06:53 AEST 1986


> > Here's a version of calloc that breaks every rule of "structured"
> > programming ever invented -- and runs about twice as fast as a
> > vanilla version:
> > /* C code deleted to reduce traffic */
> > 
> 
> So what?  This can be written "structured", and would be more
> maintainable if it were.  Surely this is not an example of
> recommended practice?

True, that code was not what I would call a "Model for maintainability",
but when time or memory is limited (Try letting an RS-232 96kb link
do calloc when there's little or no flow control) maintainability
is a secondary issue (Who said that!!! :) ).

I would be interested in other examples of this type (like a real fast
version of "bcopy", or "bzero" ) even if it looked like chinese!!!

There are times when you need speed more than structure!

Anybody got a real fast copy example that can copy 97 bytes from an odd
address in less than 5 microseconds :) ?



More information about the Comp.lang.c mailing list