public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Duft Markus" <Markus.Duft@salomon.at>
To: "Fabian Cenedese" <Cenedese@indel.ch>, <gcc-help@gcc.gnu.org>
Subject: RE: reduce compilation times?
Date: Wed, 28 Nov 2007 13:25:00 -0000	[thread overview]
Message-ID: <18597F2B47F1394A9B309945EC72411201344D39@servex01.wamas.com> (raw)

Hi!

Fabian Cenedese <> wrote:
>>> Splitting C files is different to splitting C++ files or splitting
>>> Java files, Fortran, Ada, ObjC, ....
>> 
>> In the case of C++, you can just put each method of a class in a
>> separate .C file.  Provided they all include a .H file which defines
>> the class prototype it's ok.  
> 
> The problem may not be the .cpp but the .h files. If I add a new
> member 
> or method all files of this class need to be rebuilt. With the
> independent functions in C this may be easier to do. But still, if
> everything is rebuilt then it doesn't matter how many files you
> spread your code over. 
> 
> Of course from maintenance point of view splitting files is good
> though 
> I maybe wouldn't go down to function level, more like class level.
> Otherwise the bad overview in the file is just transferred to the
> project level.

+1 ;o) Exactly how i think about it. I personally have a project with
approximately 30K lines, where each .cpp file contains exactly one class
(and it's internal-only stuff...). The project is perfectly
maintainable, further splitting into more files would only make it more
*unmaintainable*, since i would spend my time searching things... ;o)

And as Fabian sayd, in C++ the header files are the problem. It's even
fater to have a class in one C++ file as opposed to having multiple
files, because (with dependency tracking ebnabled) each of the files
including the header (which would be all of those file, right?) will be
rebuilt anyway.

BTW: has gcc a mechanism to determine, wether a change in a header file
affects a particular .cpp file? Microsoft has... They skip every file
where no affecting changes are detected...

Cheers, Markus

> 
> bye  Fabi


-- 
5. Dezember 2007
Salomon Automation am  Schweizer Forum fur Logistik, Lausanne, CH




Salomon Automation GmbH - Friesachstrasse 15 - A-8114 Friesach bei Graz
Sitz der Gesellschaft: Friesach bei Graz
UID-NR:ATU28654300 - Firmenbuchnummer: 49324 K
Firmenbuchgericht: Landesgericht fur Zivilrechtssachen Graz

             reply	other threads:[~2007-11-28 13:18 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-28 13:25 Duft Markus [this message]
2007-11-28 13:26 ` Tom St Denis
  -- strict thread matches above, loose matches on Subject: below --
2007-11-28 16:06 J.C. Pizarro
2007-11-28 16:16 ` Tom St Denis
2007-11-28 16:34   ` J.C. Pizarro
2007-11-28 18:18     ` Tom St Denis
2007-11-28 13:56 Duft Markus
2007-11-28 14:35 ` Tom St Denis
2007-11-29  0:23 ` Tim Prince
2007-11-28 12:36 Duft Markus
2007-11-28  7:57 Duft Markus
2007-11-28 12:01 ` J.C. Pizarro
2007-11-28 12:28   ` Tom St Denis
2007-11-28 12:49     ` Fabian Cenedese
2007-11-28 13:03       ` Tom St Denis
2007-11-28 12:52     ` J.C. Pizarro
2007-11-28 13:17       ` Tom St Denis
2007-11-28 13:40         ` J.C. Pizarro
2007-11-28 13:51           ` Tom St Denis
2007-11-28 13:59             ` Tom St Denis
2007-11-28 15:51             ` John (Eljay) Love-Jensen
2007-11-28 13:30       ` Ted Byers
2007-11-28 12:12 ` John (Eljay) Love-Jensen
2007-11-28 12:31   ` J.C. Pizarro
2007-11-28 12:39     ` Tom St Denis
2007-11-28 12:54     ` John (Eljay) Love-Jensen
2007-11-28 12:18 ` Tom St Denis
2007-11-28 13:09   ` Ted Byers
2007-11-27 16:07 J.C. Pizarro
2007-11-27 16:19 ` Brian Dessent
2007-11-27 16:26   ` J.C. Pizarro
     [not found] ` <5abcb5650711270804o171e1facr565beec70314af75@mail.gmail.com>
2007-11-27 16:41   ` J.C. Pizarro
2007-11-27 16:46     ` Tom St Denis
2007-11-27 17:16       ` J.C. Pizarro
2007-11-27 17:46         ` Tom St Denis
2007-11-27 18:26           ` Wesley Smith
2007-11-27 19:35       ` NightStrike
2007-11-27 19:41         ` John (Eljay) Love-Jensen
2007-11-27 19:49         ` Tom St Denis
2007-11-28  9:19           ` Brian Dessent
2007-11-28 12:07             ` Tom St Denis
2007-11-28 12:35               ` Brian Dessent
2007-11-27 17:44     ` Vladimir Vassilev
     [not found]       ` <998d0e4a0711271310k657b791cy6ad5cc5721105f4c@mail.gmail.com>
2007-11-27 22:30         ` J.C. Pizarro
2007-11-27 10:04 mahmoodn
2007-11-27 11:11 ` Andrew Haley
2007-11-27 11:15   ` mahmoodn
2007-11-27 11:30     ` Andrew Haley
2007-11-27 12:20       ` mahmoodn
2007-11-27 12:25         ` John Love-Jensen
2007-11-27 15:27           ` Tim Prince
2007-11-27 14:07         ` Andrew Haley
2007-11-28  9:01           ` mahmoodn
2007-11-28 12:11             ` John (Eljay) Love-Jensen
2007-11-30  9:15               ` mahmoodn
2007-11-30 13:33                 ` mahmoodn
2007-11-27 15:48   ` Sven Eschenberg
2007-11-27 16:27     ` Andrew Haley
2007-11-27 18:51       ` Sven Eschenberg
2007-11-27 19:21         ` Andrew Haley
2007-11-27 20:43           ` Sven Eschenberg
2007-12-01 12:20   ` mahmoodn
2007-12-03 16:14     ` Andrew Haley
2007-12-04 11:23       ` mahmoodn
2007-12-04 12:19         ` Tom Browder
2007-12-05  7:44           ` mahmoodn
2007-12-05 10:24             ` Tom Browder
2007-12-05 10:29               ` mahmoodn
2007-11-27 13:48 ` John Love-Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18597F2B47F1394A9B309945EC72411201344D39@servex01.wamas.com \
    --to=markus.duft@salomon.at \
    --cc=Cenedese@indel.ch \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).