open() speed (was Blocking for disk I/O)
Kenneth Almquist
ka at june.cs.washington.edu
Wed May 24 04:59:38 AEST 1989
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
More information about the Comp.unix.wizards
mailing list