comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic, 561.796.8997, M/S 731-96" <condicma@PWFL.COM>
Subject: Re: Beware: Rep spec on an enumeration type causes code explosion
Date: 1997/12/11
Date: 1997-12-11T00:00:00+00:00	[thread overview]
Message-ID: <97121110170208@psavax.pwfl.com> (raw)


Tucker Taft <stt@HOUDINI.CAMB.INMET.COM> writes:
>language design principles.  Your enumeration rep clause simply reconfirmed
>the default representation, but suppose it didn't?  You would be
>stuck with the overhead you managed to eliminate by simply commenting
>out the rep clause.  Of course, the compiler could recognize various
>other specials cases, such as contiguous representation starting at
>something other than zero, or evenly distributed "holey" representation
>(e.g., even numbers only), or simply not "too" sparse, or ...
>
    I'll give you a good reason why getting too smart about rep clause
    implementation might be a Bad Thing. Suppose I implement an
    enumeral type with a "confirming" rep clause because I know I'm
    dealing with a real live hardware interface or message format and
    want to make it clear that the representation for this given
    enumeration is critical. I compile & run and my timing comes out a
    given way because your compiler was smart enough to detect that my
    representation was conveniently matching the positions. So far, so
    good. At a later date the hardware or message format changes to
    include some new bit patterns which create holes in the
    representation and now when I compile I get a significantly
    different implementation for the enumeration and a corresponding
    change in performance. This is a satisfactory definition of the
    technical term: "Bad Thing".

    Sometimes poor performance isn't as bad a Bad Thing as
    inconsistent performance can be.

    MDC

Marin David Condic, Senior Computer Engineer     Voice:     561.796.8997
Pratt & Whitney GESP, M/S 731-96, P.O.B. 109600  Fax:       561.796.4669
West Palm Beach, FL, 33410-9600                  Internet:  CONDICMA@PWFL.COM
===============================================================================
    Glendower: "I can call spirits from the vasty deep."
    Hotspur: "Why so can I, or so can any man; but will they come when
    you do call for them?"
        -- Shakespeare, "Henry IV"
===============================================================================




             reply	other threads:[~1997-12-11  0:00 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-11  0:00 Marin David Condic, 561.796.8997, M/S 731-96 [this message]
1997-12-11  0:00 ` Beware: Rep spec on an enumeration type causes code explosion Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-12-11  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1997-12-09  0:00 tmoran
1997-12-05  0:00 Joe Gwinn
1997-12-06  0:00 ` Corey Minyard
1997-12-08  0:00   ` Joe Gwinn
1997-12-10  0:00     ` Robert Dewar
1997-12-06  0:00 ` Ken Garlington
1997-12-06  0:00 ` Robert Dewar
1997-12-06  0:00 ` Robert Dewar
1997-12-08  0:00   ` Joe Gwinn
1997-12-09  0:00     ` Stanley R. Allen
1997-12-06  0:00 ` Robert Dewar
1997-12-08  0:00   ` Joe Gwinn
1997-12-06  0:00 ` Robert Dewar
1997-12-06  0:00 ` Robert Dewar
1997-12-06  0:00   ` Matthew Heaney
1997-12-06  0:00 ` Kevin D. Heatwole
     [not found]   ` <dewar.881478386@merv>
1997-12-07  0:00     ` Robert Dewar
1997-12-09  0:00   ` Jim Gleason
1997-12-06  0:00 ` David Marshall
1997-12-06  0:00 ` Tucker Taft
1997-12-06  0:00   ` Robert Dewar
1997-12-06  0:00   ` Robert Dewar
1997-12-08  0:00   ` Joe Gwinn
1997-12-08  0:00     ` Mats Weber
1997-12-09  0:00     ` Tucker Taft
1997-12-09  0:00       ` Matthew Heaney
1997-12-10  0:00         ` Charles Hixson
1997-12-10  0:00       ` Robert Dewar
1997-12-10  0:00       ` Jean-Pierre Rosen
1997-12-10  0:00       ` Ken Garlington
1997-12-11  0:00         ` John G. Volan
1997-12-11  0:00           ` Ken Garlington
1997-12-12  0:00             ` Matthew Heaney
1997-12-12  0:00               ` Ken Garlington
1997-12-16  0:00                 ` John G. Volan
1997-12-17  0:00                   ` Ken Garlington
1997-12-12  0:00           ` Alan E & Carmel J Brain
1997-12-12  0:00             ` Robert Dewar
1997-12-15  0:00               ` Tucker Taft
1997-12-16  0:00                 ` Brian Rogoff
1997-12-12  0:00           ` Joe Gwinn
1997-12-12  0:00             ` Robert Dewar
1997-12-16  0:00             ` John G. Volan
1997-12-17  0:00               ` Ken Garlington
1997-12-17  0:00               ` Joe Gwinn
1997-12-17  0:00                 ` John G. Volan
1997-12-18  0:00                   ` Joe Gwinn
1997-12-10  0:00       ` Stephen Leake
1997-12-14  0:00         ` Robert Dewar
1997-12-10  0:00       ` Stanley R. Allen
1997-12-14  0:00         ` Robert Dewar
1997-12-11  0:00       ` Rakesh Malhotra
1997-12-11  0:00         ` Matthew Heaney
1997-12-12  0:00           ` Robert Dewar
1997-12-12  0:00           ` Rakesh Malhotra
1997-12-12  0:00           ` Samuel Tardieu
1997-12-12  0:00             ` Robert Dewar
1997-12-14  0:00         ` Alan E & Carmel J Brain
1997-12-12  0:00       ` Joe Gwinn
1997-12-15  0:00         ` Robert Dewar
1997-12-16  0:00           ` Joe Gwinn
1997-12-16  0:00             ` Robert Dewar
1997-12-09  0:00     ` Geert Bosch
1997-12-10  0:00       ` Robert Dewar
1997-12-07  0:00 ` Larry Kilgallen
replies disabled

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