Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ulysses.UUCP Path: utzoo!watmath!clyde!burl!ulysses!ggs From: ggs@ulysses.UUCP (Griff Smith) Newsgroups: net.lang Subject: Re: Slow Fortran I/O Message-ID: <895@ulysses.UUCP> Date: Sat, 7-Jul-84 23:25:52 EDT Article-I.D.: ulysses.895 Posted: Sat Jul 7 23:25:52 1984 Date-Received: Sun, 8-Jul-84 01:36:03 EDT References: <9625@lanl-a.UUCP> <5884@mcvax.UUCP>, <2078@rlgvax.UUCP>, <729@abnjh.UUCP> Organization: AT&T Bell Laboratories, Murray Hill Lines: 34 I don't know how VMS processes formats, but the Fortran-10 system (TOPS-10/TOPS-20) did run-time compilation as of 1981 and still does for all I know. Formats were not compiled by the Fortran compiler, they were compiled by the run-time system. The address of the format was used to search through a table of compiled formats. An attribute field in the call to the run-time system indicated whether the format was a constant (safe to re-use the compiled format) or an array (re-compile every time). Surprisingly, the UNIX(TM) Fortran run-time system almost does the same thing. Unless I am badly misreading the code, a format is compiled into an internal data structure before it is used to direct data translation. The compiled format could be re-used if someone would find a cheap way to determine that the original hasn't changed since the last compilation. Based on some experience I have had writing I/O routines in tight assembly language, a carefully written general-purpose number conversion will take about 60/MIPS microseconds per character (MIPS = speed of processor). This includes the usual paranoia, but leaves no room for fancy features such as variable format fields. The UNIX stdio package on my VAX is within 50 percent of this value; the UNIX Fortran system misses it by a factor of four. The best Fortran systems that I have seen have missed it by no worse that 50 percent. There are ways to beat the guideline value by a factor of 6, but the techniques used don't adapt easily to a general-purpose I/O system. Trademarks: UNIX - AT&T Bell Laboratories; VAX, VMS - Digital Equipment Corp. -- Griff Smith AT&T Bell Laboratories, Murray Hill Phone: (201) 582-7736 Internet: ggs@ulysses.uucp UUCP: ulysses!ggs