Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.arch Subject: Re: How wrong is MS-DOS? (or: Tools Tools Tools) Message-ID: <3126@crdos1.crd.ge.COM> Date: 15 Jan 91 21:12:59 GMT References: <11255@lanl.gov> <1991Jan13.085556.1332@kithrup.COM> Reply-To: davidsen@crdos1.crd.ge.com (bill davidsen) Organization: GE Corp R&D Center, Schenectady NY Lines: 31 In article <1991Jan13.085556.1332@kithrup.COM> sef@kithrup.COM (Sean Eric Fagan) writes: | I wouldn't be so quick with that, if I were you. Large portions of C News | (most of it?) are written as shell scripts, and C News is considerably | faster than B News (where larger portions were written in C). This brings up an optimizing problem which occurs widely. If someone (experienced) is going to optimize a program, at some point they will usually profile it. At the least it will get an eyeball analysis to see where the CPU is likely to spend time. However, people often tend to think of the shell scripts as "slow" to the exclusion of measurement. Many scripts have been rewritten as C programs, possibly with grep functionality folded in via a regcmp or similar library, *without profileing*. Since it is easy to determine the shell overhead, either by looking at an acocunting record or using time (time sh script args), it is easy to determine if any appreciable portion of the resources are in the shell. My experience is that normally there is 1-5% CPU in the shell, leaving very little room for actual improvement. Ditto replacing grep. Rarely does a program perform a grep function significantly faster than grep itself. This is harder to profile, since I have no way of predicting how much I will gain with a dedicated program. I realize that most readers of this group know this, but the intemperate remarks about not writing production code in shell brought this on. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) VMS is a text-only adventure game. If you win you can use unix.