Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!ptsfa!ihnp4!homxb!gemini From: gemini@homxb.UUCP Newsgroups: comp.arch Subject: Re: String Processing Instruction Message-ID: <182@homxb.UUCP> Date: Sun, 29-Mar-87 01:27:55 EST Article-I.D.: homxb.182 Posted: Sun Mar 29 01:27:55 1987 Date-Received: Sun, 29-Mar-87 17:19:11 EST References: <15292@amdcad.UUCP> <978@ames.UUCP> <909@spar.SPAR.SLB.COM> <236@winchester.mips.UUCP> Distribution: na Organization: PC Research, Inc. Lines: 23 Summary: Dhrystone in C != ADA I got curious myself, and profiled "ls", "awk", "cpp", "lln", and several SGS's and local applications programs for str* and mem* usage. In most cases, the str* numbers were in the 0-3% range. Diff didn't use strcat/cpy/cmp at all, though it obviously does lots of string work. But I found heavy usage of the mem* routines in many of the newer programs I tried. 7-20% was the range! If the C convention for strings had been length oriented, I suspect that Dhrystone would come out with a better approximation of reality. This would be due to the heavier usage of mem*-like routines for moving and comparing the strings. In believe that Dhrystone would have been better off doing 'stringy' things with some custom code. I'm certain that lots of string work gets done in the 'average' program, yet it appears that not much of it gets done using the str* routines. On the other hand, in my observations, I've seen lots of novice C programmers go overboard using str*, so perhaps profiling the (presumably) finely tuned UNIX utilities isn't showing us reality either. It's certain that novice programmers will be sharing the machine and their programs with me for a long time to come. Rick Richardson, PC Research, Inc: (201) 922-1134 ..!ihnp4!castor!pcrat!rick when at AT&T-CPL: (201) 834-1378 ..!ihnp4!castor!polux!rer