VMS vs. UNIX file system

Doug Gwyn gwyn at smoke.ARPA
Mon Sep 19 13:13:47 AEST 1988


In article <3951 at psuvax1.cs.psu.edu> schwartz at shire.cs.psu.edu (Scott Schwartz) writes:
>In article <3442 at crash.cts.com> jeh at crash.CTS.COM (Jamie Hanrahan) writes:
>|I offer this challenge:  Take a simple Unix filter like
>|DETAB running on some Unix system on a VAX (Ultrix, BSD, AT&T, whatever).
>|Rewrite it to use record-oriented I/O under VMS.  ...
>|We've done this and the VMS/RMS versions run *at least* twice as fast, 
>|sometimes five or six times.
>I've seen unix programs (things like a grep replacement) that got
>similar speedups by replacing stdio calls with read/write and a large
>buffer.  I wonder how much of that 2-6x is from overhead in stdio,
>rather than in the filesystem.  
>Here is some sample data:

The point is valid, although your two examples were not functionally
identical, since in one case you were inspecting EVERY character in
a file and in the other you never inspected ANY character.  User-mode
overhead from stdio tends to be comparable to system overhead for
typical applications, assuming a fairly good implementation of stdio.
Certainly it is a mistake to use stdio to implement "cat", for example
(for several reasons), but for most applications the additional
services provided by stdio (buffering, etc.) are useful, as is the
fact that the stdio functions are available on all systems whereas
open()/read()/etc. may not be (and when they are, their semantics are
not as well defined).

The analogous UNIX "challenge" would be:  Take a simple UNIX filter
(I have no idea where he gets "detab", which is not standard on UNIX)
and rewrite it to use direct system calls on UNIX...

Personally I think I have better things to do than crank out system-
specific code.



More information about the Comp.unix.wizards mailing list