Path: utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!rutgers!att!dptg!pegasus!psrc From: psrc@pegasus.ATT.COM (Paul S. R. Chisholm) Newsgroups: comp.sys.ibm.pc Subject: Re: why are C compiles so slow? Summary: lots of disk activity (for several reasons) Message-ID: <4272@pegasus.ATT.COM> Date: 26 Nov 89 07:05:26 GMT References: <19500044@uxh.cso.uiuc.edu> Organization: AT&T Bell Laboratories Lines: 39 < BACK TO THE FUTURE PART III (coming May 1990): It's about time. > In article <19500044@uxh.cso.uiuc.edu>, beaucham@uxh.cso.uiuc.edu writes: > In developing new programs in C I find that the most time is taken in waiting > for compile and link (including some fairly large libraries). (I am working > with a genuine 6 MHz AT.) Even if I go to V DISK, it is still slow. My > question is -- What factors most strongly determine the speed of compile? It'd help if you mentioned if the time was being taken in the compilation proper (generation of the .OBJ's) or the link. Also, VDISK uses *extended* memory, which requires resetting the CPU; it's far slower than a RAM disk based on *expanded* memory. For the compilation itself, you want to put the header files on a RAM disk if you can. (Turbo C, which #includes tons of junk, is fast; Turbo Pascal, which picks up the same kind of information from pre-compiled, compact binary files, is *awesome*.) I once heard an estimate that twenty percent of a compiler's time was spent skipping blanks and comments; you could try taking them (carefully!) out of the standard header files. For the link, obviously, put the libraries (and maybe the final .EXE) on a RAM disk. Getting the .OBJ files in a RAM disk would save time in both compilation and linking, but I don't see it as a serious bottleneck. Someone mentioned buying the right compiler. Microsoft C has several passes, each of them a separate program that has to be run, with temporary files between each pass. Put both the programs and the temporary files on a RAM disk (see your manual for details). Turbo C does the whole compilation in one executable (except for linking with the command line version, which invokes the separate linker), and stores all inter-phase information in RAM (except for object files). > Jim Beauchamp j-beauchamp@uiuc.edu Paul S. R. Chisholm, AT&T Bell Laboratories att!pegasus!psrc, psrc@pegasus.att.com, AT&T Mail !psrchisholm I'm not speaking for the company, I'm just speaking my mind.