From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9676 invoked by alias); 28 Nov 2007 13:26:35 -0000 Received: (qmail 9666 invoked by uid 22791); 28 Nov 2007 13:26:35 -0000 X-Spam-Check-By: sourceware.org Received: from web88303.mail.re4.yahoo.com (HELO web88303.mail.re4.yahoo.com) (216.39.53.226) by sourceware.org (qpsmtpd/0.31) with SMTP; Wed, 28 Nov 2007 13:26:29 +0000 Received: (qmail 33938 invoked by uid 60001); 28 Nov 2007 13:26:27 -0000 X-YMail-OSG: QQLsLywVM1nOS0KjAUcOGbMtK2R8PpejMQb1Qp.BM4gCEJIgvA70hUnjsHEjMmNe8A_wJP8.UlCqCiHveJtXXzT9OjlhLObUuxmNq43jDTXwyWJexLXtgg-- Received: from [99.242.109.220] by web88303.mail.re4.yahoo.com via HTTP; Wed, 28 Nov 2007 08:26:27 EST Date: Wed, 28 Nov 2007 13:30:00 -0000 From: Ted Byers Subject: Re: reduce compilation times? To: "J.C. Pizarro" , Tom St Denis , gcc-help@gcc.gnu.org In-Reply-To: <998d0e4a0711280449h41b0187bq370681c97d492c55@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <278873.65976.qm@web88303.mail.re4.yahoo.com> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg00364.txt.bz2 --- "J.C. Pizarro" wrote: > On 2007/11/28, Tom St Denis > wrote: > > J.C. Pizarro wrote: > > > On 2007/11/28, Duft Markus > wrote: > > > > > >> Hi! > > >> > > >> I assume, that all strategies discussed here > are targeted at C. now what > > >> about C++, how do things behave there? As far > as i know C++ is much > > >> different, and requires completely different > thinking with regards to > > >> splitting source in more files, etc. > > >> > > >> Cheers, Markus > > >> > > > > > > Your comment is good. > > > > > > Splitting C files is different to splitting C++ > files or splitting Java files, > > > Fortran, Ada, ObjC, .... > > > > > > As GCC is made in C-only then we only need to > split C files to reduce the > > > recompilation time if we want. > > > > > > For other projects made in C++, Java, Fortran, > Ada, ObjC, ...., they are > > > hard to split their files. > > > > > This is so blatantly false ... I don't know about > fortran/ada/obj, but > > for C++ and Java you can trivially factor your > code. > > It's not false, you get wrong. > No! Tom got it right! Had I responded when I first saw that nonsense, I would have used harsher language than he did! I don't use ObjC or Ada, but a fortran project can be rationally divided among several compilation units, as can C++. I have seen fortran library projects in which there is only one function in most of the compilation units in the project. Java requires on file per class, but you can rationally design your classes so that each is relatively small. This allows a single complex class to make use of a suite of small classes, so its member functions can often be one or two lines of code, simply referencing instances and functions of other classes. This is easy to do, at least if you have sufficient experience coding in a variety of languages! It comes down to thinking about your code and how best to implement what you need. Cheers Ted