Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 SMI; site creare.uucp Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!spuxll!abnji!u1100a!pyuxww!gamma!epsilon!zeta!sabre!bellcore!decvax!dartvax!creare!gda From: gda@creare.uucp (gda) Newsgroups: net.unix-wizards Subject: Speed in pipes Message-ID: <357@creare.uucp> Date: Wed, 12-Jun-85 22:20:17 EDT Article-I.D.: creare.357 Posted: Wed Jun 12 22:20:17 1985 Date-Received: Sat, 15-Jun-85 10:21:33 EDT Organization: Creare R & D, Great Hollow Rd,, Hanover, N. H. 03755 Lines: 29 Are pipes started by the shell faster than those set up by "popen", "fork and exec", etc. ? I've been building a three-generation program (parent-child-grandchild) in which the three communicate in an ideal manner (no back-talk from the children), and I tested the system previous to writing all the spawning code by using explicit pipes in the command line : prog1 | prog2 (prog2 spawned prog3) When I timed this, it ran reasonably fast, so I finished the code for spawning of "prog2" by "prog1". When I timed the final form it ran only half as fast as when done with the explicit pipe. I ran it under three conditions in both "before" and "after" cases, one with a small amount of input data, one with a lot, and one in-between. There was a fairly linear relation between data size and execution time. I tried this with "popen" and with "fork, exec, and dup2" and got roughly the same results. This was done on a Masscomp, which is mostly System V. I used "timex" to measure the "user" time. I don't have access to source code. Any ideas? Am I missing something? Gray Abbott Creare Inc. Hanover, NH {...dartvax!creare!gda}