From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 2-FEB-1993 02:16:45.73 To: andrew@DDSW1.MCS.COM, info-vax@sri.com CC: GWDGI::"info-vax@sri.com"@CRVAX.SRI.COM, MOELLER@CRVAX.SRI.COM Subj: RE: IO IS SLOW WITH VAX C Andrew Gilbert writes: > This may be common knowledge, but does anyone have input as to > why IO is so slow.... through the stdio routines under VAX C? > We have been running tests with optical platters, and the > stdio stuff is slower than our slowest drives. [...] I haven't written on this theme for a long time, so let me re-iterate: The observation is correct for files opened without VMS-specific attributes. VAXC stdio "buffers" disk files to a block size of 512 bytes, i.e. it reads/writes them blocks by blocks (see your direct I/O count). No "external" settings influence this behaviour (in particular, no "multiblock count" RMS defaults, as is common with other languages). You have to modify the program's calls to fopen() and freopen(), [possibly also open(),creat(),etc.], and if you want one of the 'default' files [stdin/stdout/stderr] directed to a disk file via DEFINE/USER_MODE, don't forget to explicitly freopen() them. The most 'innocent' modification to all of these function calls is the addition of an extra argument, ,"mbc=16" (use a higher value if you like) This construct re-instates the multi-block count normally used by RMS, and does *not* influence the semantics, as the addition of other VAXC- specific arguments usually does. My recommendation of course assumes that you mostly do *sequential* I/O (as about 99% of C programs do). If you don't, maybe the VAXC RTL's defaults were made for you ... I have done this modification to most GNU programs - I couldn't use them without [I want GAWK to be *faster* than DCL :-]. GNU compress becomes really useful when modified this way! Wolfgang J. Moeller, GWDG, D-3400 Goettingen, F.R.Germany | Disclaimer ... PSI%(0262)45050352008::MOELLER Phone: +49 551 201516 | No claim intended! Internet: moeller@gwdgv1.dnet.gwdg.de | This space intentionally left blank.