comp.lang.ada
 help / color / mirror / Atom feed
* compilation time [was Re: Magnavox consultant]
@ 1994-10-20  7:29 tmoran
  1994-10-20 14:22 ` Norman H. Cohen
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: tmoran @ 1994-10-20  7:29 UTC (permalink / raw)


I just observed a make, compile with full optimization, and link
of 2200 lines in 24 source files, in almost exactly one minute
on my 486 (Janus Ada 83 compiler).  That translates to about 22
million lines in a solid week.  But if the source files are
small, and the compiler is loaded once for each file, and there
is inadequate disk caching, things could go downhill in a hurry.
My limited experience is that C compilers generally load once,
with a bunch of source files on the command line, while Ada
compilers more often compile one file per compiler invocation.
Is that generally true?



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consultant]
  1994-10-20  7:29 compilation time [was Re: Magnavox consultant] tmoran
@ 1994-10-20 14:22 ` Norman H. Cohen
  1994-10-20 18:15 ` Kent Mitchell
  1994-10-20 19:05 ` compilation time [was Re: Magnavox consult Richard L. Conn
  2 siblings, 0 replies; 14+ messages in thread
From: Norman H. Cohen @ 1994-10-20 14:22 UTC (permalink / raw)


In article <385686$501@news.delphi.com>, tmoran@bix.com writes: 

|> I just observed a make, compile with full optimization, and link
|> of 2200 lines in 24 source files, in almost exactly one minute
|> on my 486 (Janus Ada 83 compiler).  That translates to about 22
|> million lines in a solid week.  But if the source files are
|> small, and the compiler is loaded once for each file, and there
|> is inadequate disk caching, things could go downhill in a hurry.

A 2200-line program is not likely to have many with clauses per
compilation unit.  The performance of some compilers is sensitive to the
number of with clauses, because of the time taken to read in the
associated information from the program library (so much so that the GNAT
team decided it would be faster to reparse the source of the with'ed
units).  Thus it cannot be assumed that this test scales up to a large
program with complex dependencies among compilation units.

|> My limited experience is that C compilers generally load once,
|> with a bunch of source files on the command line, while Ada
|> compilers more often compile one file per compiler invocation.
|> Is that generally true?

It depends on the compiler.  The AIX Ada 6000 compiler, for example,
mimics the traditional "cc" command-line interface, allowing multiple
source files, .o files, and .a (archive) files to be specified on the
command line.  All the source files are compiled and the resulting object
files are linked with the other .o files named on the command line, using
archived object files as needed.  (This compiler, originally developed by
Oliver Cole Systems, is now maintained as an OCS product, under a new
name that slips my mind at the moment.)

--
Norman H. Cohen    ncohen@watson.ibm.com



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consultant]
  1994-10-20  7:29 compilation time [was Re: Magnavox consultant] tmoran
  1994-10-20 14:22 ` Norman H. Cohen
@ 1994-10-20 18:15 ` Kent Mitchell
  1994-10-20 19:05 ` compilation time [was Re: Magnavox consult Richard L. Conn
  2 siblings, 0 replies; 14+ messages in thread
From: Kent Mitchell @ 1994-10-20 18:15 UTC (permalink / raw)


tmoran@bix.com wrote:
: My limited experience is that C compilers generally load once,
: with a bunch of source files on the command line, while Ada
: compilers more often compile one file per compiler invocation.
: Is that generally true?

No I would not say this is generally true but there are some compilers that
could have this restriction.  I that were a restriction, then the compile
time could go up quite dramtically.

--
Kent Mitchell                   | One possible reason that things aren't
Technical Consultant            | going according to plan is .....
Rational Software Corporation   | that there never *was* a plan!



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consult
  1994-10-20  7:29 compilation time [was Re: Magnavox consultant] tmoran
  1994-10-20 14:22 ` Norman H. Cohen
  1994-10-20 18:15 ` Kent Mitchell
@ 1994-10-20 19:05 ` Richard L. Conn
  1994-10-25 18:08   ` Eric C. Newton
  2 siblings, 1 reply; 14+ messages in thread
From: Richard L. Conn @ 1994-10-20 19:05 UTC (permalink / raw)


One thing to keep in mind about your metrics is the KIND of Ada
code being compiled.  If there is heavy reliance on subunits,
for example, a lot of small files containing many subunits will
probably take longer than a lot of small files with no subunits.

Rick






^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consultant]
@ 1994-10-20 21:01 tmoran
  1994-10-21 13:23 ` John Cosby
  1994-10-23 15:24 ` Norman H. Cohen
  0 siblings, 2 replies; 14+ messages in thread
From: tmoran @ 1994-10-20 21:01 UTC (permalink / raw)


> A 2200-line program is not likely to have many with clauses per
> compilation unit.  ... cannot be assumed that this test scales up
> to a large program with complex dependencies among compilation units.
That raises the interesting question of how the number of with's
scales with total program size in the real world.  Presumably in a
good modular design it's much less than linear, but how much?  There
are rules of thumb about 'a single module shouldn't be more than
N lines' - should a single module not have more than M with's?



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consultant]
  1994-10-20 21:01 compilation time [was Re: Magnavox consultant] tmoran
@ 1994-10-21 13:23 ` John Cosby
  1994-10-23 15:24 ` Norman H. Cohen
  1 sibling, 0 replies; 14+ messages in thread
From: John Cosby @ 1994-10-21 13:23 UTC (permalink / raw)


tmoran@bix.com wrote:
>> A 2200-line program is not likely to have many with clauses per
>> compilation unit.  ... cannot be assumed that this test scales up
>> to a large program with complex dependencies among compilation units.
>That raises the interesting question of how the number of with's
>scales with total program size in the real world.  Presumably in a
>good modular design it's much less than linear, but how much?  There
>are rules of thumb about 'a single module shouldn't be more than
>N lines' - should a single module not have more than M with's?

I'll have to vote against making that a hard and fast rule.  I've been writing 
X/Motif user interface code using Ada bindings for a couple of years, and I 
find the folks who generated the bindings subdivided their packages pretty
well.  Unfortunately, to get anything done with a complex window, I have
to with several packages; in one callback package, I have 7 with's for X,
X_Lib, and Xm packages, before I begin withing application packages to
call for services.  If there were a programmatic guideline that I could
only have M with's per N lines, I'd have had to apply for a waiver, unless
the M was set so high as to not really matter.

--- 
John Cosby - cosby@greatwall.cctt.com - cosbyj@nefarious.saic.com
  I've been porting bits of Ada back to C lately... my brain thinks it got 
  thrown into reverse....



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consultant]
  1994-10-20 21:01 compilation time [was Re: Magnavox consultant] tmoran
  1994-10-21 13:23 ` John Cosby
@ 1994-10-23 15:24 ` Norman H. Cohen
  1 sibling, 0 replies; 14+ messages in thread
From: Norman H. Cohen @ 1994-10-23 15:24 UTC (permalink / raw)


In article <386ls1$lu7@news.delphi.com>, tmoran@bix.com writes: 

|> That raises the interesting question of how the number of with's
|> scales with total program size in the real world.  Presumably in a
|> good modular design it's much less than linear, but how much?  There
|> are rules of thumb about 'a single module shouldn't be more than
|> N lines' - should a single module not have more than M with's?

The high priests of software engineering methodology measure this
characteristic in terms of "fan-in" and "fan-out" in a module dependency
graph (except that, lacking Ada's formalization of what it means for one
module to depend on another, some SE methodologists speak of module
"controlling" module B (i.e., calling its routines) rather than of B
"depending on" A (which also encompasses data dependence).  In general,
high fan-out (large numbers of with'ed units) is bad and high fan-in (a
unit being with'ed by many other units, and thus representing a
fundamental, reusable abstraction) is good.

Various books provide specific numbers, but these numbers seem highly
dependent on the language and on the strategy for forming cohesive
modules.  In addition, the citing of specific numbers is dangerous
because, even though these numbers are intended as rough guidelines,
meant guide intution rather than to supplant it, specific numbers often
find their way into rigid, naively enforced  programming rules.

--
Norman H. Cohen    ncohen@watson.ibm.com



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consultant]
       [not found] <38afut$8m9@news.delphi.com>
@ 1994-10-24 11:15 ` Robert I. Eachus
  1994-10-24 23:19   ` Bob Duff
  0 siblings, 1 reply; 14+ messages in thread
From: Robert I. Eachus @ 1994-10-24 11:15 UTC (permalink / raw)


In article <38afut$8m9@news.delphi.com> tmoran@bix.com writes:

 > I can't imagine attempting to maintain a package with more than 500
 > 'with's, so perhaps compilation time has an exponent significantly
 > greater than one initially, but decreasing to one at 1,000
 > packages.  Who has statistics?  (And does C, what with 'include's,
 > scale similarly?)

   Not statistics, but a rule of thumb.  If package specifications
average more than six withs, or if there are more than about ten on
the package bodies, or if more than 16 total apply to a particular
subunit, your coupling and cohesion are out of control, and a project
wide design review is in order.

   Again the above is not a set of magic numbers, and in any case they
are averages, not per unit limits, but these values seem to be around
the knee of the (Ada 83) curve.  I have no idea yet what the numbers
are for 9X.  Child units both make counting more difficult, and mean
that there may be significantly more with clauses in the same (Ada 83)
design, because massive packages have been decomposed into subsystems
with many child packages.  Should you count an entire subsystem as one
"with"?  I don't know, I have trouble enough in Ada 83 eliminating
double counting.

--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consultant]
  1994-10-24 11:15 ` Robert I. Eachus
@ 1994-10-24 23:19   ` Bob Duff
  1994-10-25  4:16     ` David Moore
  1994-10-25 13:58     ` Norman H. Cohen
  0 siblings, 2 replies; 14+ messages in thread
From: Bob Duff @ 1994-10-24 23:19 UTC (permalink / raw)


In article <EACHUS.94Oct24111507@spectre.mitre.org>,
Robert I. Eachus <eachus@spectre.mitre.org> wrote:
> ...I have no idea yet what the numbers
>are for 9X.  Child units both make counting more difficult, and mean
>that there may be significantly more with clauses in the same (Ada 83)
>design, because massive packages have been decomposed into subsystems
>with many child packages.  Should you count an entire subsystem as one
>"with"?  I don't know, I have trouble enough in Ada 83 eliminating
>double counting.

Note also that each child unit will tend to have *fewer* with_clauses,
since the child is implementing only a part of the whole abstraction,
and will presumably need to with fewer things.  I don't know how this
will affect the overall numbers.

Another interesting point is that with-ing a big thing is worse than
with-ing a small thing, in terms of understandability.  Child units
allow a client to with just a few parts of a given abstraction, instead
of the whole thing, which might increase the number of with_clauses, but
decrease the amount of with-ed "stuff".

[I hate using the word "with" as verb.  :-( ]

- Bob
-- 
Bob Duff                                bobduff@inmet.com
Oak Tree Software, Inc.
Ada 9X Mapping/Revision Team (Intermetrics, Inc.)



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consultant]
  1994-10-24 23:19   ` Bob Duff
@ 1994-10-25  4:16     ` David Moore
  1994-10-25 13:58     ` Norman H. Cohen
  1 sibling, 0 replies; 14+ messages in thread
From: David Moore @ 1994-10-25  4:16 UTC (permalink / raw)


bobduff@dsd.camb.inmet.com (Bob Duff) writes:

>decrease the amount of with-ed "stuff".

>[I hate using the word "with" as verb.  :-( ]

>- Bob
>-- 
>Bob Duff                                bobduff@inmet.com
>Oak Tree Software, Inc.
>Ada 9X Mapping/Revision Team (Intermetrics, Inc.)

withed is a perfectly good English word - meaning tied up with strips
of willow or similar wood - so bound fast.

Seems totally appropriate to me.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consultant]
  1994-10-24 23:19   ` Bob Duff
  1994-10-25  4:16     ` David Moore
@ 1994-10-25 13:58     ` Norman H. Cohen
  1994-10-25 23:33       ` Robert Dewar
  1 sibling, 1 reply; 14+ messages in thread
From: Norman H. Cohen @ 1994-10-25 13:58 UTC (permalink / raw)


In article <Cy7A46.6K2@inmet.camb.inmet.com>, bobduff@dsd.camb.inmet.com
(Bob Duff) writes: 

|> Note also that each child unit will tend to have *fewer* with_clauses,
|> since the child is implementing only a part of the whole abstraction,
|> and will presumably need to with fewer things.  I don't know how this
|> will affect the overall numbers.

More to the point, what is a child of package P in an Ada 94 program is
likely to have been written in Ada 83 as a separate library unit
(conceptually part of the same subsystem, but too large to be included in
a monolithic spec for package P) mentioning P in a with clause.  Making
the unit a child allows it to reference the facilities of P without a
with clause.

|> [I hate using the word "with" as verb.  :-( ]

William Safire's "On Language" column in this past Sunday's New York
Times Magazine was concerned with the emerging use of "with" as an
ADVERB, as in "I'll have a cup of coffee with," or "Fax me the papers so
I can take them with."

--
Norman H. Cohen    ncohen@watson.ibm.com



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consult
  1994-10-20 19:05 ` compilation time [was Re: Magnavox consult Richard L. Conn
@ 1994-10-25 18:08   ` Eric C. Newton
  1994-10-25 22:23     ` Robert Dewar
  0 siblings, 1 reply; 14+ messages in thread
From: Eric C. Newton @ 1994-10-25 18:08 UTC (permalink / raw)


I regularly work with a one-million line C++ program that takes about
six hours to compile on a '486/33 with SCO Unix and the GNU C++ compiler.

LOC are counted with 'wc'.
Few, if any templates are used.
Optimizations are used.
Generated code is not counted.

Of course, this statistic, like many of the others given here are quite
silly.

-Eric




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consult
  1994-10-25 18:08   ` Eric C. Newton
@ 1994-10-25 22:23     ` Robert Dewar
  0 siblings, 0 replies; 14+ messages in thread
From: Robert Dewar @ 1994-10-25 22:23 UTC (permalink / raw)



one million lines of C++ compiling in 6 hours on a 486.

That sounds reasonable, GNAT will generally compile about the same speed
as g++. On my thinkpad, a 75MHz 486 with no 2nd-level cache, it takes 
about 50 minutes to compile the GNAT sources, which are about 150,000 
lines of Ada.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: compilation time [was Re: Magnavox consultant]
  1994-10-25 13:58     ` Norman H. Cohen
@ 1994-10-25 23:33       ` Robert Dewar
  0 siblings, 0 replies; 14+ messages in thread
From: Robert Dewar @ 1994-10-25 23:33 UTC (permalink / raw)


"making the unit a child allows it to reference the facilities  ..
without using a with clause"

true, so what, this doesn't mean that it compiles faster (in fact child
units tend to increase compile time if you are not careful, because they
do implicit with's that you might not always need).




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~1994-10-25 23:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-10-20  7:29 compilation time [was Re: Magnavox consultant] tmoran
1994-10-20 14:22 ` Norman H. Cohen
1994-10-20 18:15 ` Kent Mitchell
1994-10-20 19:05 ` compilation time [was Re: Magnavox consult Richard L. Conn
1994-10-25 18:08   ` Eric C. Newton
1994-10-25 22:23     ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1994-10-20 21:01 compilation time [was Re: Magnavox consultant] tmoran
1994-10-21 13:23 ` John Cosby
1994-10-23 15:24 ` Norman H. Cohen
     [not found] <38afut$8m9@news.delphi.com>
1994-10-24 11:15 ` Robert I. Eachus
1994-10-24 23:19   ` Bob Duff
1994-10-25  4:16     ` David Moore
1994-10-25 13:58     ` Norman H. Cohen
1994-10-25 23:33       ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox