strcpy

Ray Dunn ray at micomvax.UUCP
Wed Apr 13 08:33:42 AEST 1988


In article <1988Mar31.183321.4740 at sq.uucp> msb at sq.UUCP (Mark Brader) writes:
>Regarding:
>> > If a machine has a fast instruction that
>> > does a search for a byte and a fast block move instruction, it would
>> > probably be best for strcpy to be written....

Hmm.  I fell foul to this practice in MicroSoft 4.0 string library routines
fairly recently.

strchr (at least, probably others) unbeknownst to me does this to determine
the length of the string prior to doing the character search.

....Now, to optimize my file operations, I used a 32K buffer, and was using
strchr to find the line endings!  Can you say S.L.O.W.

I wonder how much software is out there just now running s.l.o.w.l.y
because of this practice?

Ray Dunn.  ..{philabs,mnetor}!micomvax!ray



More information about the Comp.lang.c mailing list