jump tables and cases

Matthew Fluet Matthew Fluet <fluet@CS.Cornell.EDU>
Mon, 4 Dec 2000 03:26:42 -0500 (EST)


> Didn't  we  decide  to go with binary search for big integer case statements?
> The data from the GNU Eiffel paper seemed pretty convincing that it is  often
> much getter and basically never much worse.

O.k.  We might consider doing the same thing for cases on words.  I have a
program that has a large case statement on a word value, and the resulting
code is a sequence of  cmpl/je  pairs.  I kept seeing that and assumed it
was a by-product of by translation of switch (and hoped it would go away
with a jump table implementation), but I guess it turns out that it's just
what would naturally fall out of the sequence of ifs.

> I was confused initially by this message trying to see what the importance of
> IntInf.int switches was (i.e., BIG integers).

Sorry, I just meant a case statement on an integer with a large number of
cases.