From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: style/efficiency question
Date: 1997/10/27
Date: 1997-10-27T00:00:00+00:00 [thread overview]
Message-ID: <3455060F.7774@gsfc.nasa.gov> (raw)
In-Reply-To: 3454B885.2352@pseserv3.fw.hac.com
W. Wesley Groleau x4923 wrote:
>
> Does anyone have a clear recent (1992 or later) example of a situation
> where it was not possible to generate a CASE statement that was more
> efficient than an IF/THEN/ELSIF/... ?
Do you mean time efficient or space efficient?
gcc uses if/then/else for case statements with small numbers of choices.
Certainly if there are only two cases, an if/then/else is likely to be
both more efficient in both time and space.
If the case choices are sparsely distributed, you either build a big
sparse jump table (space inefficient), or use a compressed table of some
sort (time inefficient).
--
- Stephe
prev parent reply other threads:[~1997-10-27 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-10-27 0:00 style/efficiency question W. Wesley Groleau x4923
1997-10-27 0:00 ` Stephen Leake [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox