Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwvax!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: open() speed (was Blocking for disk I/O) Keywords: open(2), 4.2 BSD Message-ID: <17643@mimsy.UUCP> Date: 20 May 89 14:13:19 GMT References: <159@zebra.UUCP> <1608@auspex.auspex.com> <2@minya.UUCP> <8295@june.cs.washington.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 23 In article <8295@june.cs.washington.edu> ka@june.cs.washington.edu (Kenneth Almquist) writes: >... 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. Here is mine (entered with the `cat' editor :-) ), and my results: main(){register int fd,i; for(i=1000;--i>=0;) fd=open("foo",0), close(fd); } % time ./t 0.1u 0.9s 0:01 84% 1+3k 0+0io 2pf+0w 4.3BSD > Ultrix ... ? -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris