comp.lang.ada
 help / color / mirror / Atom feed
* style/efficiency question
@ 1997-10-27  0:00 W. Wesley Groleau x4923
  1997-10-27  0:00 ` Stephen Leake
  0 siblings, 1 reply; 2+ messages in thread
From: W. Wesley Groleau x4923 @ 1997-10-27  0:00 UTC (permalink / raw)



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/... ?

Don't bother with examples of CASE that are more efficient--almost
everyone knows these exist.

-- 
----------------------------------------------------------------------
    Wes Groleau, Hughes Defense Communications, Fort Wayne, IN USA
Senior Software Engineer - AFATDS                  Tool-smith Wanna-be
                    wwgrol AT pseserv3.fw.hac.com

Don't send advertisements to this domain unless asked!  All disk space
on fw.hac.com hosts belongs to either Hughes Defense Communications or 
the United States government.  Using email to store YOUR advertising 
on them is trespassing!
----------------------------------------------------------------------




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

* Re: style/efficiency question
  1997-10-27  0:00 style/efficiency question W. Wesley Groleau x4923
@ 1997-10-27  0:00 ` Stephen Leake
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Leake @ 1997-10-27  0:00 UTC (permalink / raw)



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




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

end of thread, other threads:[~1997-10-27  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-27  0:00 style/efficiency question W. Wesley Groleau x4923
1997-10-27  0:00 ` Stephen Leake

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