Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!mit-eddie!uw-beaver!uw-june!ka From: ka@june.cs.washington.edu (Kenneth Almquist) Newsgroups: comp.unix.wizards Subject: Re: open() speed (was Blocking for disk I/O) Summary: Silly me. Keywords: open(2), 4.2 BSD Message-ID: <8324@june.cs.washington.edu> Date: 23 May 89 18:59:38 GMT References: <159@zebra.UUCP> <1608@auspex.auspex.com> <2@minya.UUCP> <17643@mimsy.UUCP> Organization: U of Washington, Computer Science, Seattle Lines: 27 I wrote: >> ... So I tried writing a little C program >> that opened and closed a file in the current directory 1000 times: >> >> 17.3 real 0.0 user 3.2 sys >> >> This is on an otherwise idle system running Ultrix 3.0, a 4.2 BSD >> derivative. Chris Torek's numbers: > % time ./t > 0.1u 0.9s 0:01 84% 1+3k 0+0io 2pf+0w > > 4.3BSD > Ultrix ... ? Torek > ka. The file I was opening was on an NFS file system rather than a local file system. Using a local file decreases the times to 0.4 real 0.0 user 0.4 sys Also, the using the empty file rather than an executable program for the true command is faster when NFS is not involved: 2.8 real 0.3 user 2.3 sys (when using empty file) 4.2 real 0.3 user 3.8 sys (when using executable) Kenneth Almquist