Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!beta!hc!ames!amelia!msf From: msf@amelia (Michael S. Fischbein) Newsgroups: comp.misc Subject: Re: Faster/cheaper execution of Unix pipelines? A proposal. Message-ID: <3126@ames.arpa> Date: Fri, 16-Oct-87 08:01:14 EDT Article-I.D.: ames.3126 Posted: Fri Oct 16 08:01:14 1987 Date-Received: Sat, 17-Oct-87 18:35:13 EDT References: <385@ohlone.UUCP> Sender: usenet@ames.arpa Reply-To: msf@amelia.UUCP (Michael S. Fischbein) Organization: NASA Langley Research Center, Hampton, VA Lines: 46 Keywords: Unix pipes, program composition, small is beautiful In article <385@ohlone.UUCP> nelson@ohlone.UUCP (Bron Nelson) writes: >There has been considerable discussion (mostly in comp.arch) about >"Big Programs Hurt Performance" and the relative merits of a single >program with lots of options, vs. communicating small programs, >in particular the use of pipes in the Unix world. The canonical >example used is the Unix "ls" command producing single-column and >multi-column output, as opposed to piping single column output >through "pr." > I think the answer is not to give up on "small is beautiful;" > I ask for your comments, proposals, and >examples of existing systems that do a good job. > >I'll use the simple pipeline "ls | pr -4" as my example. OK, so will I. > I'll call this mythical beast the "Pipeline Composer," Goes on to describe a way of implementing the Pipeline Composer. Bron works for Cray and probably has their machines in mind when he conceptualizes a program; his technique is intended to minimize the number of (high overhead) fork/execs, among other things. But on most machines, a fork/exec does not impose the huge overhead it does on a Cray (well, I don't know abou XMPs or 1's, but the overhead on the 2 is awfully big compared to other UNIX boxes). One major complaint about typing ls | pr -4 -t instead of ls -C (the -C is needed in UNICOS) is the extra typing involved and the additional requirements it places on the (perhaps naive) user. One major complaint about the list of options approach is the size and complexity of each utility. A reasonable compromise (and one that I think is taken by many of the utilities) is to use the "system" or "popen" system calls available. Ls doesn't have to develop and debug a column routine; a system call to pr will work. That doesn't involve creating a new Pipeline Composer, either. mike Michael Fischbein msf@prandtl.nas.nasa.gov ...!seismo!decuac!csmunix!icase!msf These are my opinions and not necessarily official views of any organization.