www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/10/23/23:33:39

From: Dag Nummedal <nummedal AT pvv DOT unit DOT no>
Date: Mon, 24 Oct 94 03:17:31 +0100
To: Kimberley Burchett <OKRA AT max DOT tiac DOT net>
Cc: DJGPP Mailing List <djgpp AT sun DOT soe DOT clarkson DOT edu>
Subject: Re: C++ compile speed tips?
References: <Pine DOT 3 DOT 89 DOT 9410212230 DOT A5889-0100000 AT max DOT tiac DOT net>

Kimberley Burchett writes:
 > 
 >   Given the fact that the C++ compiler seems to crash every time I 
 > misspell something (quite often, in other words) and the fact that I only 

Get the last version of GNU C++ (2.5.7 was the last precompiled for
DJGPP). Use this to do "raw" compiles, and use the latest version for final
compilation.



 >   So, since it would seem that most of the time is spent swapping, I'm
 > wondering if perhaps increasing SmartDrive's cache size would help. 

If you are swapping, you should probably decrease the size of your cache and
ramdisk.

There are three kinds of diskaccess. The first is the loading of gcc, cpp,
cc1plus and gas (and maybe the linker). This access will be speeded up by a
larger disk cache. I think the cache must be at least as big as the largest
program (cc1plus) to have any effect.

The second type of diskaccess is the temporary files made during the different
steps of the compile. cpp emits a single file with all defines and comments
removed to cc1plus, which emits assembly code to gas. There are compiler
switches (-E and -S) that you can use to see these files. These files should
be placed in a ramdisk, without cacheing.

The worst kind of diskaccess is when go32 starts swapping. This means that
part of your program and data gets written out to disk and reread (probably
several times), and will destroy any effect the ramdisk and cache can give.

Here's some tips for tuning:

Remove smartdrive and ramdrive. Test time used to compile largest file.

Point GO32TMP (swapping) to a floppy, and test again.
Point TMPDIR (temp. files) to the floppy, and test time.

This should give you an idea where your greatest problem is.

If you want to do something about your temporary files, make a ramdisk large
enough to hold at least output of preprosessor and assembly code for the
largest file.

If your largest problem is swapping, test with several sizes, to find best
fit. Compile repeatedly (2 different files) with each cache size.

You can also try making a large ramdisk (1-1.5M), making a compressed drive
with a disk compressor, and swapping to this compressed drive. If the disk is
large enough, you could also put your temp files on it. This might actually be
faster than using a diskcache.

Other options: There are some options to make compilation of classes faster
(check docs). Find out what options gcc gives to the other programs (gcc -v),
and make a small batfile to run them by hand. This could give you a few
hundred K extra (I'm not sure how much of gcc is stuck in memory when the
other programs run.)

Personally I use a 486dx with 16M memory, with 4M ramdisk and 4M cache (about
10-20 seconds for an ordinary file :-), and a 386sx with 2M ram, which I run
without any cache or anything (10-15 minutes per compile :-( 

Conclusion: Beg, Borrow, Steal or even Buy more RAM.
-Dag Nummedal

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019