On Mon, 20 Apr 1998, James Turner wrote: >You are very correct that it can cause extra recompilation. However, in >most cases, this isn't so big an issue, at least for me; recompiling my >code takes around a minute. I'm assuming high end Pentium or slow Pentium II. Not everyone has such a fast computer to take time on. A 486/33 I used to compile on took 20 minutes to compile the entire code base. (30 minutes if the other users did intesive stuff.) >But rarely is a change in a .h file going to occur only in one of the >smaller ones. More commonly, changes will occur in one of the bigger >files (utils.h, structs.h), which will need a major recompile anyway. I've been editing oasis.h often lately and I'm glad it only has to recompile about 6 things when I modify it. Even when you do have a fast computer, it's annoying to wait for something that shouldn't need recompiled. >It's pointless to have the same group of includes in a large number of >different files; if several headers are included in all the sources, >it generally makes sense to put them all into one. Particularly if >those headers are simply prototypes (something I've done away with in >my code, at least manually; see the script posted elsewhere for >automatic prototype generation). -Wmissing-prototypes But then if you put a all prototyes together, minor changes in one file cause everything to recompile. >Compile-time memory requirements are not really an issue. It is for many people, and especially C++. >The compile process is inherently file based, and broken into passes. The >extra headers won't increase the compilation's memory requirements by >anything noticeable Have you ever played with templates extensively? >particularly since: a) the compilation process takes much more memory >optimizing than in headers -- should we turn optimization off? (IMO in >general yes, but for different reasons). Because Visual C++ cannot generate debugging info when optimizing? >b) the memory it adds would be tiny compared to other processes -- even >tcsh requires over 600k of memory while running. GCC usually reaches 3 MB of RAM, more if you have bigger files than stock. >Memory is cheap. Disk space is cheap. Compile time is barely >affected. Recompiling is an issue, but not a large one. Perhaps you'd like to donate money to everyone then? -- George Greer - Me@Null.net | Genius may have its limitations, but stupidity http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST